diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-29 15:20:15 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-29 15:38:22 +0100 |
commit | f21f75eb6f7c7b5aaefd8e1c369fe09e1d91cc68 (patch) | |
tree | 61397e4c93fc35a1952167a8e8e9be9902d4733c /core | |
parent | 6fdbf79046b6404331017c53044507e639efdcc3 (diff) |
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.
Diffstat (limited to 'core')
-rw-r--r-- | core/config/project_settings.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 7aaa9a46b7..d0de39a79d 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -1200,6 +1200,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; GLOBAL_DEF_BASIC("application/config/name", ""); |