mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 13:37:42 -05:00
refactor: Task Manager related code
This commit is contained in:
@@ -63,9 +63,11 @@ namespace hex::init {
|
||||
// destructors to be called correctly. To prevent crashes when ImHex exits, we need to delete all shared data
|
||||
|
||||
EventManager::post<EventImHexClosing>();
|
||||
|
||||
EventManager::clear();
|
||||
|
||||
// Terminate all asynchronous tasks
|
||||
TaskManager::exit();
|
||||
|
||||
while (ImHexApi::Provider::isValid())
|
||||
ImHexApi::Provider::remove(ImHexApi::Provider::get());
|
||||
ContentRegistry::Provider::impl::getEntries().clear();
|
||||
@@ -114,8 +116,6 @@ namespace hex::init {
|
||||
|
||||
ShortcutManager::clearShortcuts();
|
||||
|
||||
TaskManager::getRunningTasks().clear();
|
||||
|
||||
ContentRegistry::DataProcessorNode::impl::getEntries().clear();
|
||||
|
||||
ContentRegistry::DataFormatter::impl::getEntries().clear();
|
||||
|
||||
@@ -116,14 +116,12 @@ namespace {
|
||||
|
||||
|
||||
/**
|
||||
* @brief Deinitializes ImHex by running all exit tasks and terminating all asynchronous tasks
|
||||
* @brief Deinitializes ImHex by running all exit tasks
|
||||
*/
|
||||
void deinitializeImHex() {
|
||||
// Run exit tasks
|
||||
init::runExitTasks();
|
||||
|
||||
// Terminate all asynchronous tasks
|
||||
TaskManager::exit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user