From 369b05405576ce78510f3e6d02b3c27d49cc0b75 Mon Sep 17 00:00:00 2001 From: MCJack123 Date: Sun, 14 May 2023 18:57:10 -0400 Subject: [PATCH] v2.7.4: Fixed critical crash in queueTask --- src/runtime.cpp | 2 +- vcpkg.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime.cpp b/src/runtime.cpp index 41e6cd89..fe8ca041 100644 --- a/src/runtime.cpp +++ b/src/runtime.cpp @@ -67,7 +67,7 @@ monitor * findMonitorFromWindowID(Computer *comp, unsigned id, std::string* side } void* queueTask(const std::function& func, void* arg, bool async) { - if (std::this_thread::get_id() == mainThreadID && !async) return func(arg); + if (std::this_thread::get_id() == mainThreadID && (!async || taskQueue.locked())) return func(arg); TaskQueueItem * task = new TaskQueueItem; task->func = func; task->data = arg; diff --git a/vcpkg.json b/vcpkg.json index f219524f..c363e8da 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -32,7 +32,7 @@ { "name": "sdl2-mixer", "default-features": true, - "features": [ "libmodplug", "opusfile", "fluidsynth" ] + "features": [ "libmodplug", "opusfile", "fluidsynth", "libflac", "mpg123" ] } ] },