use qscoped pointer this might fix the deadlock on exit

This commit is contained in:
Patrick von Reth 2015-02-01 19:41:35 +01:00
parent 8be2a991a0
commit 1292423c73
2 changed files with 2 additions and 5 deletions

View File

@ -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);
}

View File

@ -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;