mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Crash when an error occurrs when opening a file through the cli
This commit is contained in:
@@ -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));
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user