Fixed logger scheduling stuff

This commit is contained in:
JeremyStar™ 2024-05-03 21:26:42 +02:00
parent 95aef2ea48
commit a32b00d118
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D
2 changed files with 3 additions and 1 deletions

View file

@ -91,6 +91,7 @@ var initduration_initialization: int = 0
var initduration_complete_initialization: int = 0 var initduration_complete_initialization: int = 0
# +++ initialization +++ # +++ initialization +++
# Preinitialization
func _init(new_config: CoreConfiguration = CoreConfiguration.new()) -> void: func _init(new_config: CoreConfiguration = CoreConfiguration.new()) -> void:
var inittime: int = Time.get_ticks_msec() var inittime: int = Time.get_ticks_msec()
name = "CORE" name = "CORE"
@ -103,6 +104,7 @@ func _init(new_config: CoreConfiguration = CoreConfiguration.new()) -> void:
initialize_scheduler() initialize_scheduler()
initduration_preinitialization = Time.get_ticks_msec() - inittime initduration_preinitialization = Time.get_ticks_msec() - inittime
# Initialization
func _ready() -> void: func _ready() -> void:
var inittime: int = Time.get_ticks_msec() var inittime: int = Time.get_ticks_msec()
inject_modules() inject_modules()

View file

@ -52,11 +52,11 @@ 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:
instances.remove_at(instances.find(instance)) instances.remove_at(instances.find(instance))