mirror of
https://github.com/status-im/snorenotify.git
synced 2025-02-11 07:56:24 +00:00
use qscoped pointer this might fix the deadlock on exit
This commit is contained in:
parent
8be2a991a0
commit
1292423c73
@ -65,9 +65,6 @@ Snore::NotificationData::NotificationData(const Notification &old, const QString
|
||||
|
||||
NotificationData::~NotificationData()
|
||||
{
|
||||
if (!m_timeoutTimer.isNull()) {
|
||||
m_timeoutTimer->deleteLater();
|
||||
}
|
||||
notificationCount--;
|
||||
snoreDebug(SNORE_DEBUG) << "Deleting Notification: ActiveNotifications" << notificationCount << "id" << m_id << "Close Reason:" << m_closeReason;
|
||||
}
|
||||
@ -100,7 +97,7 @@ void NotificationData::setCloseReason(Snore::Notification::CloseReasons r)
|
||||
QTimer *NotificationData::timeoutTimer()
|
||||
{
|
||||
if (m_timeoutTimer.isNull()) {
|
||||
m_timeoutTimer = new QTimer();
|
||||
m_timeoutTimer.reset(new QTimer());
|
||||
m_timeoutTimer->setSingleShot(true);
|
||||
m_timeoutTimer->setProperty("notificationID", m_id);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ private:
|
||||
QHash<int, Action> m_actions;
|
||||
Hint m_hints;
|
||||
Notification m_toReplace;
|
||||
QPointer<QTimer> m_timeoutTimer;
|
||||
QScopedPointer<QTimer> m_timeoutTimer;
|
||||
|
||||
static uint notificationCount;
|
||||
static uint m_idCount;
|
||||
|
Loading…
x
Reference in New Issue
Block a user