1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Project Manager: Fix hacky code for project rename

Instantiating a new ProjectSettings is *not* the way to go.
ConfigFile works just fine to read/change a single value.

Fixes memory leaks as the instantiated ProjectSettings was never freed.
Forbid doing this to prevent such problems.

Fixes #25661.

(cherry picked from commit f21f75eb6f)
This commit is contained in:
Rémi Verschelde
2022-11-29 15:20:15 +01:00
committed by Haoyu Qiu
parent 4aa84f1083
commit 4ee12fa80b
2 changed files with 19 additions and 17 deletions

View File

@@ -1049,6 +1049,7 @@ ProjectSettings::ProjectSettings() {
// Initialization of engine variables should be done in the setup() method,
// so that the values can be overridden from project.godot or project.binary.
CRASH_COND_MSG(singleton != nullptr, "Instantiating a new ProjectSettings singleton is not supported.");
singleton = this;
last_order = NO_BUILTIN_ORDER_BASE;
last_builtin_order = 0;