mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +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.
This commit is contained in:
parent
6fdbf79046
commit
f21f75eb6f
2 changed files with 19 additions and 17 deletions
|
|
@ -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", "");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue