Commit df4f5a13 authored by David Faure's avatar David Faure
Browse files

Properly cleanup in notificationmanagertest

Summary:
The call to "quit" is symmetrical with
  QMetaObject::invokeMethod(&manager, "init", Qt::DirectConnection);
on line 56 of the test (due to NoThread mode).

But for the call to quit() to work, the base class has to not assert.

Test Plan: bin/notificationmanagertest in an ASAN build

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: kde-pim

Differential Revision: https://phabricator.kde.org/D21132
parent 6422cb49
......@@ -156,6 +156,8 @@ private Q_SLOTS:
QVERIFY(!manager.itemFetchScope()->fetchTags());
QVERIFY(!manager.itemFetchScope()->fetchRelations());
QVERIFY(!manager.itemFetchScope()->fetchVirtualReferences());
QMetaObject::invokeMethod(&manager, "quit", Qt::DirectConnection);
}
};
......
......@@ -82,12 +82,13 @@ void AkThread::init()
void AkThread::quit()
{
Q_ASSERT(m_startMode != NoThread);
Q_ASSERT(thread() == QThread::currentThread());
if (DataStore::hasDataStore()) {
DataStore::self()->close();
}
thread()->quit();
if (m_startMode != NoThread) {
thread()->quit();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment