1
0
mirror of synced 2024-11-28 01:20:51 +01:00

fix: Crash on macOS when dirtying or undirtying a provider from a thread

Fixes #1799
This commit is contained in:
WerWolv 2024-07-05 20:59:20 +02:00
parent bb0a8047ea
commit 88e2fa04e7

View File

@ -5,6 +5,7 @@
#include <hex/api/project_file_manager.hpp>
#include <hex/api/imhex_api.hpp>
#include <hex/api/event_manager.hpp>
#include <hex/api/task_manager.hpp>
#include <hex/helpers/utils_macos.hpp>
#include <hex/helpers/logger.hpp>
@ -65,8 +66,10 @@ namespace hex {
});
EventProviderDirtied::subscribe([this](prv::Provider *) {
TaskManager::doLater([] {
macosMarkContentEdited(m_window);
});
});
ProjectFile::registerHandler({
.basePath = "",
@ -75,7 +78,10 @@ namespace hex {
return true;
},
.store = [this](const std::fs::path &, Tar &) {
TaskManager::doLater([] {
macosMarkContentEdited(m_window, false);
});
return true;
}
});