fix: Crash when an error occurrs when opening a file through the cli

This commit is contained in:
WerWolv
2025-11-30 23:14:02 +01:00
parent f47a248768
commit 4e2dcef7d7

View File

@@ -6,6 +6,7 @@
#include <list>
#include <memory>
#include <mutex>
#include <hex/api/task_manager.hpp>
namespace hex {
@@ -51,11 +52,11 @@ namespace hex {
template<typename ...Args>
static void open(Args && ... args) {
std::lock_guard lock(getMutex());
auto toast = std::make_unique<T>(std::forward<Args>(args)...);
getQueuedToasts().emplace_back(std::move(toast));
TaskManager::doLater([=] {
auto toast = std::make_unique<T>(args...);
getQueuedToasts().emplace_back(std::move(toast));
});
}
};
}
}