aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/singletons/GameSingleton.cpp
diff options
context:
space:
mode:
author Spartan322 <Megacake1234@gmail.com>2023-12-03 18:33:37 +0100
committer Spartan322 <Megacake1234@gmail.com>2023-12-05 22:25:02 +0100
commit291022316a4a3c742be92abd0d2b94256df60143 (patch)
treedc9a4d1a107902f0b4de21eeb503c4d901379ce0 /extension/src/openvic-extension/singletons/GameSingleton.cpp
parente01d332f407420db84fbfd207f18c3fec1c1b6a3 (diff)
Update to Godot 4.2 Stable Release
Fix compiledb Fix memory leak caused by LoadLocalisation::add_message's translations static variable
Diffstat (limited to 'extension/src/openvic-extension/singletons/GameSingleton.cpp')
-rw-r--r--extension/src/openvic-extension/singletons/GameSingleton.cpp5
1 files changed, 4 insertions, 1 deletions
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 <functional>
+
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/core/error_macros.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
@@ -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;
}