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 +}