From 291022316a4a3c742be92abd0d2b94256df60143 Mon Sep 17 00:00:00 2001 From: Spartan322 Date: Sun, 3 Dec 2023 12:33:37 -0500 Subject: Update to Godot 4.2 Stable Release Fix compiledb Fix memory leak caused by LoadLocalisation::add_message's translations static variable --- extension/src/openvic-extension/singletons/GameSingleton.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'extension/src/openvic-extension/singletons/GameSingleton.cpp') diff --git a/extension/src/openvic-extension/singletons/GameSingleton.cpp b/extension/src/openvic-extension/singletons/GameSingleton.cpp index db3dd3f..4a80eb9 100644 --- a/extension/src/openvic-extension/singletons/GameSingleton.cpp +++ b/extension/src/openvic-extension/singletons/GameSingleton.cpp @@ -1,5 +1,7 @@ #include "GameSingleton.hpp" +#include + #include #include #include @@ -553,7 +555,8 @@ Error GameSingleton::load_defines_compatibility_mode(PackedStringArray const& fi UtilityFunctions::push_error("Failed to hardcoded defines!"); err = FAILED; } - if (!dataloader.load_localisation_files(LoadLocalisation::add_message)) { + auto add_message = std::bind_front(&LoadLocalisation::add_message, LoadLocalisation::get_singleton()); + if (!dataloader.load_localisation_files(add_message)) { UtilityFunctions::push_error("Failed to load localisation!"); err = FAILED; } -- cgit v1.2.3-56-ga3b1