mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
fix: use deleteLater
for network objects and order them (#5297)
This commit is contained in:
parent
8db0bb464d
commit
2ea24c1a9d
|
@ -201,7 +201,7 @@
|
||||||
- Dev: Refactor `StreamerMode`. (#5216, #5236)
|
- Dev: Refactor `StreamerMode`. (#5216, #5236)
|
||||||
- Dev: Cleaned up unused code in `MessageElement` and `MessageLayoutElement`. (#5225)
|
- Dev: Cleaned up unused code in `MessageElement` and `MessageLayoutElement`. (#5225)
|
||||||
- Dev: Adapted `magic_enum` to Qt's Utf-16 strings. (#5258)
|
- Dev: Adapted `magic_enum` to Qt's Utf-16 strings. (#5258)
|
||||||
- Dev: `NetworkManager`'s statics are now created in its `init` method. (#5254)
|
- Dev: `NetworkManager`'s statics are now created in its `init` method. (#5254, #5297)
|
||||||
- Dev: `clang-tidy` CI now uses Qt 6. (#5273)
|
- Dev: `clang-tidy` CI now uses Qt 6. (#5273)
|
||||||
- Dev: Enabled `InsertNewlineAtEOF` in `clang-format`. (#5278)
|
- Dev: Enabled `InsertNewlineAtEOF` in `clang-format`. (#5278)
|
||||||
|
|
||||||
|
|
|
@ -24,15 +24,19 @@ void NetworkManager::deinit()
|
||||||
assert(NetworkManager::workerThread);
|
assert(NetworkManager::workerThread);
|
||||||
assert(NetworkManager::accessManager);
|
assert(NetworkManager::accessManager);
|
||||||
|
|
||||||
|
// delete the access manager first:
|
||||||
|
// - put the event on the worker thread
|
||||||
|
// - wait for it to process
|
||||||
|
NetworkManager::accessManager->deleteLater();
|
||||||
|
NetworkManager::accessManager = nullptr;
|
||||||
|
|
||||||
if (NetworkManager::workerThread)
|
if (NetworkManager::workerThread)
|
||||||
{
|
{
|
||||||
NetworkManager::workerThread->quit();
|
NetworkManager::workerThread->quit();
|
||||||
NetworkManager::workerThread->wait();
|
NetworkManager::workerThread->wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
delete NetworkManager::accessManager;
|
NetworkManager::workerThread->deleteLater();
|
||||||
NetworkManager::accessManager = nullptr;
|
|
||||||
delete NetworkManager::workerThread;
|
|
||||||
NetworkManager::workerThread = nullptr;
|
NetworkManager::workerThread = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue