From 88e2fa04e74ae52845456f76e822af20ed4ace39 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 5 Jul 2024 20:59:20 +0200 Subject: [PATCH] fix: Crash on macOS when dirtying or undirtying a provider from a thread Fixes #1799 --- main/gui/source/window/macos_window.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main/gui/source/window/macos_window.cpp b/main/gui/source/window/macos_window.cpp index 4f52efbdf..ab5d98d9e 100644 --- a/main/gui/source/window/macos_window.cpp +++ b/main/gui/source/window/macos_window.cpp @@ -5,6 +5,7 @@ #include #include #include + #include #include #include @@ -65,7 +66,9 @@ namespace hex { }); EventProviderDirtied::subscribe([this](prv::Provider *) { - macosMarkContentEdited(m_window); + TaskManager::doLater([] { + macosMarkContentEdited(m_window); + }); }); ProjectFile::registerHandler({ @@ -75,7 +78,10 @@ namespace hex { return true; }, .store = [this](const std::fs::path &, Tar &) { - macosMarkContentEdited(m_window, false); + TaskManager::doLater([] { + macosMarkContentEdited(m_window, false); + }); + return true; } });