Quit the dash communicator thread before destroying it
Fixes "QThread: Destroyed while thread is still running" Fixes: #1508485
Approved by: Andrea Cimitan
commit5948a4eccb451e28ddbafea6037b8fd6bc5e91c6
authorAlbert Astals Cid <albert.astals@canonical.com>
dateMon 11 Jan 2016, 17:36 (11 years ago)
parentf5d88356b86c8b
plugins/Unity/DashCommunicator/dashcommunicator.cpp+6
@@ -27,6 +27,12 @@ DashCommunicator::DashCommunicator(QObject *parent):
2727 start();
2828}
2929
30+DashCommunicator::~DashCommunicator()
31+{
32+ quit();
33+ wait();
34+}
35+
3036void DashCommunicator::setCurrentScope(int index, bool animate, bool isSwipe)
3137{
3238 m_mutex.lock();
plugins/Unity/DashCommunicator/dashcommunicator.h+1−1
@@ -28,7 +28,7 @@ class DashCommunicator: public QThread
2828 Q_OBJECT
2929public:
3030 explicit DashCommunicator(QObject *parent = 0);
31− ~DashCommunicator() = default;
31+ ~DashCommunicator();
3232
3333public Q_SLOTS:
3434 void setCurrentScope(int index, bool animate, bool isSwipe);