diff --git a/autotests/server/notificationmanagertest.cpp b/autotests/server/notificationmanagertest.cpp --- a/autotests/server/notificationmanagertest.cpp +++ b/autotests/server/notificationmanagertest.cpp @@ -156,6 +156,8 @@ QVERIFY(!manager.itemFetchScope()->fetchTags()); QVERIFY(!manager.itemFetchScope()->fetchRelations()); QVERIFY(!manager.itemFetchScope()->fetchVirtualReferences()); + + QMetaObject::invokeMethod(&manager, "quit", Qt::DirectConnection); } }; diff --git a/src/server/akthread.cpp b/src/server/akthread.cpp --- a/src/server/akthread.cpp +++ b/src/server/akthread.cpp @@ -82,12 +82,13 @@ 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(); + } }