From 1292423c737c325bfdeaf114a2a2592a5cf6ad10 Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Sun, 1 Feb 2015 19:41:35 +0100 Subject: [PATCH] use qscoped pointer this might fix the deadlock on exit --- src/core/notification/notification_p.cpp | 5 +---- src/core/notification/notification_p.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/notification/notification_p.cpp b/src/core/notification/notification_p.cpp index ad52629..b3b7a0e 100644 --- a/src/core/notification/notification_p.cpp +++ b/src/core/notification/notification_p.cpp @@ -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); } diff --git a/src/core/notification/notification_p.h b/src/core/notification/notification_p.h index e3381e5..8a65bb1 100644 --- a/src/core/notification/notification_p.h +++ b/src/core/notification/notification_p.h @@ -70,7 +70,7 @@ private: QHash m_actions; Hint m_hints; Notification m_toReplace; - QPointer m_timeoutTimer; + QScopedPointer m_timeoutTimer; static uint notificationCount; static uint m_idCount;