Compare commits

..

No commits in common. "09dee490e511f67c45b702b38dce8bb2b3ddfbc2" and "d62467bd0576361f07f803cffb3e436b5885e1f7" have entirely different histories.

2 changed files with 5 additions and 10 deletions

View file

@ -208,7 +208,7 @@ Thank you for using the CORE Framework to develop your application or game!""".r
func reload_configuration(new_config: CoreConfiguration = CoreConfiguration.new()) -> void: func reload_configuration(new_config: CoreConfiguration = CoreConfiguration.new()) -> void:
var initialized = config != null var initialized = config != null
if initialized: loggeri.verb("Reloading CORE's configuration") if initialized: loggeri.verb("Reloading CORE's configuration")
if is_instance_valid(config): config.free() if config != null: config.queue_free()
config = new_config.duplicate() config = new_config.duplicate()
if is_devmode(): # Override configuration in development mode if is_devmode(): # Override configuration in development mode
config.logger_level = CoreTypes.LoggerLevel.DIAG config.logger_level = CoreTypes.LoggerLevel.DIAG
@ -291,23 +291,20 @@ func cleanup() -> void:
else: else:
loggeri.diag("Calling cleanup hook #" + str(hook)) loggeri.diag("Calling cleanup hook #" + str(hook))
await cleanup_hooks[hook].call() await cleanup_hooks[hook].call()
await get_tree().process_frame
loggeri.verb("Unregistering custom modules") loggeri.verb("Unregistering custom modules")
for module in custom_modules_node.get_children(): await unregister_custom_module(module.name) for module in custom_modules_node.get_children(): await unregister_custom_module(module.name)
await get_tree().process_frame
loggeri.verb("Removing custom module support") loggeri.verb("Removing custom module support")
remove_child(custom_modules_node) remove_child(custom_modules_node)
custom_modules_node.queue_free() custom_modules_node.queue_free()
await get_tree().process_frame
loggeri.verb("Unloading built-in modules") loggeri.verb("Unloading built-in modules")
var modules_reverse: Array[String] = modules.duplicate() var modules_reverse: Array[String] = modules.duplicate()
modules_reverse.reverse() modules_reverse.reverse()
for module in modules_reverse: for module in modules_reverse:
await get(module)._cleanup() await get(module)._cleanup()
get(module).queue_free() get(module).queue_free()
await get_tree().process_frame
print("Freeing configuration") print("Freeing configuration")
config.free() config.queue_free()
await get_tree().process_frame
print("Freeing") print("Freeing")
queue_free() queue_free()

View file

@ -52,15 +52,13 @@ func _cleanup() -> void:
func _schedule() -> void: func _schedule() -> void:
var instances_remove_enty: Array[CoreLoggerInstance] = [] var instances_remove_enty: Array[CoreLoggerInstance] = []
for instance in instances: for instance in instances:
instances_remove_enty.append(instance)
if !is_instance_valid(instance): continue if !is_instance_valid(instance): continue
if !is_instance_valid(instance.parent): if !is_instance_valid(instance.parent):
logger.diag("Removing instance '" + instance.name + "'") logger.diag("Removing instance '" + instance.name + "'")
instance.queue_free() instance.queue_free()
instances_remove_enty.append(instance)
for instance in instances_remove_enty: for instance in instances_remove_enty:
var index: int = instances.find(instance) instances.remove_at(instances.find(instance))
if index == -1: logger.error("Invalid index -1")
else: instances.remove_at(index)
func _pull_config() -> void: func _pull_config() -> void:
config_level = core.config.logger_level config_level = core.config.logger_level