Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into chatterino7
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Apr 5, 2024
2 parents 3d00ac7 + 2ea24c1 commit ad58d9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
- Dev: Refactor `StreamerMode`. (#5216, #5236)
- Dev: Cleaned up unused code in `MessageElement` and `MessageLayoutElement`. (#5225)
- 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: Enabled `InsertNewlineAtEOF` in `clang-format`. (#5278)

Expand Down
10 changes: 7 additions & 3 deletions src/common/network/NetworkManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ void NetworkManager::deinit()
assert(NetworkManager::workerThread);
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)
{
NetworkManager::workerThread->quit();
NetworkManager::workerThread->wait();
}

delete NetworkManager::accessManager;
NetworkManager::accessManager = nullptr;
delete NetworkManager::workerThread;
NetworkManager::workerThread->deleteLater();
NetworkManager::workerThread = nullptr;
}

Expand Down

0 comments on commit ad58d9a

Please sign in to comment.