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

View file

@ -52,11 +52,11 @@ func _cleanup() -> void:
func _schedule() -> void:
var instances_remove_enty: Array[CoreLoggerInstance] = []
for instance in instances:
instances_remove_enty.append(instance)
if !is_instance_valid(instance): continue
if !is_instance_valid(instance.parent):
logger.diag("Removing instance '" + instance.name + "'")
instance.queue_free()
instances_remove_enty.append(instance)
for instance in instances_remove_enty:
instances.remove_at(instances.find(instance))