Update cleanup call order

This commit is contained in:
JeremyStar™ 2024-04-12 17:03:37 +02:00
parent 780c553f79
commit 82b4362859
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -227,16 +227,16 @@ func get_custom_module(module_name: String) -> CoreBaseModule:
## Unloads all custom modules, built-in modules, frees any of CORE's classes and lastly itself.
func cleanup() -> void:
loggeri.info("Cleaning up")
config.queue_free()
for module in custom_modules_node.get_children(): unregister_custom_module(module.name)
remove_child(custom_modules_node)
custom_modules_node.queue_free()
var modules_reverse: Array[String] = modules.duplicate()
modules_reverse.reverse()
for module in modules_reverse:
await get(module)._cleanup()
get(module).loggeri.queue_free()
get(module).queue_free()
for module in custom_modules_node.get_children(): unregister_custom_module(module.name)
remove_child(custom_modules_node)
custom_modules_node.queue_free()
config.queue_free()
queue_free()
## Returns if the framework is in development mode.