Call queue_free() on scenes during removal
This commit is contained in:
parent
96c17c7287
commit
899bd338df
1 changed files with 15 additions and 5 deletions
20
src/sms.gd
20
src/sms.gd
|
@ -77,11 +77,21 @@ func remove_scene(sname: String, force_remove: bool = false) -> bool:
|
||||||
if force_remove: await logger.crashf("Sms", "force_remove = true is not allowed", true)
|
if force_remove: await logger.crashf("Sms", "force_remove = true is not allowed", true)
|
||||||
logger.verbf("Sms", "Removing scene \"" + sname + "\"")
|
logger.verbf("Sms", "Removing scene \"" + sname + "\"")
|
||||||
match(exists(sname)):
|
match(exists(sname)):
|
||||||
CoreTypes.SceneType.DEBUG: scenes_debug.remove_child(scenes[sname]["class"])
|
CoreTypes.SceneType.DEBUG:
|
||||||
CoreTypes.SceneType.CUTSCENE: scenes_cutscene.remove_child(scenes[sname]["class"])
|
scenes_debug.remove_child(scenes[sname]["class"])
|
||||||
CoreTypes.SceneType.MENU: scenes_menu.remove_child(scenes[sname]["class"])
|
scenes[sname]["class"].queue_free()
|
||||||
CoreTypes.SceneType.MAIN: scenes_main.remove_child(scenes[sname]["class"])
|
CoreTypes.SceneType.CUTSCENE:
|
||||||
CoreTypes.SceneType.BACKGROUND: scenes_background.remove_child(scenes[sname]["class"])
|
scenes_cutscene.remove_child(scenes[sname]["class"])
|
||||||
|
scenes[sname]["class"].queue_free()
|
||||||
|
CoreTypes.SceneType.MENU:
|
||||||
|
scenes_menu.remove_child(scenes[sname]["class"])
|
||||||
|
scenes[sname]["class"].queue_free()
|
||||||
|
CoreTypes.SceneType.MAIN:
|
||||||
|
scenes_main.remove_child(scenes[sname]["class"])
|
||||||
|
scenes[sname]["class"].queue_free()
|
||||||
|
CoreTypes.SceneType.BACKGROUND:
|
||||||
|
scenes_background.remove_child(scenes[sname]["class"])
|
||||||
|
scenes[sname]["class"].queue_free()
|
||||||
CoreTypes.SceneType.NONE:
|
CoreTypes.SceneType.NONE:
|
||||||
logger.errorf("Sms", "Scene \"" + sname + "\" does not exist")
|
logger.errorf("Sms", "Scene \"" + sname + "\" does not exist")
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue