From 4e2dcef7d75318bde9df17ff8d60f2e73e5969e5 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sun, 30 Nov 2025 23:14:02 +0100 Subject: [PATCH] fix: Crash when an error occurrs when opening a file through the cli --- lib/libimhex/include/hex/ui/toast.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/libimhex/include/hex/ui/toast.hpp b/lib/libimhex/include/hex/ui/toast.hpp index 905c233a2..d987848b2 100644 --- a/lib/libimhex/include/hex/ui/toast.hpp +++ b/lib/libimhex/include/hex/ui/toast.hpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace hex { @@ -51,11 +52,11 @@ namespace hex { template static void open(Args && ... args) { - std::lock_guard lock(getMutex()); - - auto toast = std::make_unique(std::forward(args)...); - getQueuedToasts().emplace_back(std::move(toast)); + TaskManager::doLater([=] { + auto toast = std::make_unique(args...); + getQueuedToasts().emplace_back(std::move(toast)); + }); } }; -} \ No newline at end of file +}