diff --git a/src/spice2x/avs/core.cpp b/src/spice2x/avs/core.cpp index d9b4bcb..80c9110 100644 --- a/src/spice2x/avs/core.cpp +++ b/src/spice2x/avs/core.cpp @@ -1743,7 +1743,7 @@ namespace avs { deferredlogs::defer_error_messages({ "AVS filesystem initialization failure was previously detected during boot!", fmt::format(" ERROR: directory could not be created: {}", src_path.string().c_str()), - fmt::format(" this crash may have been caused by bad contents in {}", avs::core::CFG_PATH.c_str()), + fmt::format(" if you see a crash, it may have been caused by bad contents in {}", avs::core::CFG_PATH.c_str()), " fix the XML file and try again" }); } diff --git a/src/spice2x/util/deferlog.cpp b/src/spice2x/util/deferlog.cpp index 7471458..21dd314 100644 --- a/src/spice2x/util/deferlog.cpp +++ b/src/spice2x/util/deferlog.cpp @@ -13,15 +13,18 @@ namespace deferredlogs { " double check your spice audio options/patches, and try again" }; + std::mutex deferred_errors_mutex; std::vector> deferred_errors; void defer_error_messages(std::initializer_list messages) { + std::unique_lock lock(deferred_errors_mutex); deferred_errors.emplace_back(messages); } void dump_to_logger() { static std::once_flag printed; std::call_once(printed, []() { + std::unique_lock lock(deferred_errors_mutex); if (!deferred_errors.empty()) { log_warning("deferred_error", "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");