diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2023-01-15 16:13:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-15 16:13:50 +0100 |
commit | 91fedb60de6011434938499a9d4a7d4fd1cd4f06 (patch) | |
tree | 0aee81ffb22f947c62e81502ab10d3dcf12115c2 /scene/main | |
parent | 9711abe78773426644b640d6052273203931555e (diff) | |
parent | 55bf948fe793af87bb26969cad0d3497e4f4a20b (diff) |
Merge pull request #71459 from akien-mga/fix-change_scene-leak
Fix change_scene memory leak due to duplicate instantiation
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/scene_tree.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index b5c587c0aa..fbe11c94d1 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -1134,7 +1134,6 @@ Error SceneTree::change_scene_to_packed(const Ref<PackedScene> &p_scene) { ERR_FAIL_COND_V_MSG(p_scene.is_null(), ERR_INVALID_PARAMETER, "Can't change to a null scene. Use unload_current_scene() if you wish to unload it."); Node *new_scene = p_scene->instantiate(); - new_scene = p_scene->instantiate(); ERR_FAIL_COND_V(!new_scene, ERR_CANT_CREATE); call_deferred(SNAME("_change_scene"), new_scene); |