summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-09-08 15:12:32 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-09-08 15:12:32 (GMT)
commit3ffb9c1f7409643a163e11de27d7068c55ed929f (patch)
tree984efb82d2ca0d2d76132c0ac9bdad66b0fd6913
parent414e09a5e80fa175845b2a0a1466bd0901a71e52 (diff)
Fix NotificationManager crash on shutdown
-rw-r--r--src/server/notificationmanager.cpp4
-rw-r--r--src/server/notificationmanager.h3
2 files changed, 2 insertions, 5 deletions
diff --git a/src/server/notificationmanager.cpp b/src/server/notificationmanager.cpp
index a971471..01bc464 100644
--- a/src/server/notificationmanager.cpp
+++ b/src/server/notificationmanager.cpp
@@ -75,10 +75,6 @@ void NotificationManager::quit()
delete mTimer;
delete mNotifyThreadPool;
qDeleteAll(mSubscribers);
- // FIXME: There seems to be a QTimer somewhere that we must delete here,
- // otherwise we get "Can't stop QTimer from a different thread" warning
- // from QObject::~QObject()
- qDeleteAll(children());
AkThread::quit();
}
diff --git a/src/server/notificationmanager.h b/src/server/notificationmanager.h
index 8813c96..8eb5b45 100644
--- a/src/server/notificationmanager.h
+++ b/src/server/notificationmanager.h
@@ -25,6 +25,7 @@
#include <private/protocol_p.h>
#include <QtCore/QTimer>
+#include <QPointer>
class NotificationManagerTest;
class QLocalSocket;
@@ -66,7 +67,7 @@ private:
QTimer *mTimer;
QThreadPool *mNotifyThreadPool;
- QVector<NotificationSubscriber *> mSubscribers;
+ QVector<QPointer<NotificationSubscriber>> mSubscribers;
int mDebugNotifications;
friend class NotificationSubscriber;