diff --git a/src/core/notification/notification_p.cpp b/src/core/notification/notification_p.cpp index c1d10c4..81a8eab 100644 --- a/src/core/notification/notification_p.cpp +++ b/src/core/notification/notification_p.cpp @@ -68,6 +68,10 @@ 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; } @@ -102,7 +106,7 @@ QTimer *NotificationData::timeoutTimer() { if(m_timeoutTimer.isNull()) { - m_timeoutTimer.reset(new QTimer()); + m_timeoutTimer = 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 0269599..653a368 100644 --- a/src/core/notification/notification_p.h +++ b/src/core/notification/notification_p.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace Snore{ @@ -76,7 +76,7 @@ private: QHash m_actions; Hint m_hints; Notification m_toReplace; - QScopedPointer m_timeoutTimer; + QPointer m_timeoutTimer;