Godot Version
4.3
Question
why i get WARNING: ObjectDB instances leaked at exit (run with --verbose for details), from one scene , and not from other scene with same setting? i know EntityStatsBaseFuncRes that give the problem, i wish i could free the resource, but it dont have free() or queue_free(). i also try put null in func _exit_tree() -> void: stats_func = null
, but doest work either. so pls tell me what should i do.
30 time (run current scene f16) , the one give warning 25/30 warning, the other one 0/30 warning
this node give the warning
class_name Player_ND extends CharacterBodyEntity_ND
var stats_func : EntityStatsBaseFuncRes = EntityStatsBaseFuncRes.new()
func _ready() -> void:
get_tree().quit()
this one dont give warning
class_name Mob_Node extends CharacterBodyEntity_ND
var stats_func : EntityStatsBaseFuncRes = EntityStatsBaseFuncRes.new()
func _ready() -> void:
get_tree().quit()
pass
and this the cause the warning
in this Resouce, dont have any node, all just calculate value.
class_name EntityStatsBaseFuncRes extends Resource
class_name GbFunc extends Resource
GbFunc, just static func, to calculate value, like func sum_all_value_in_arr( array) -> float
##################################################################
this the error and bunch of orphan
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
at: cleanup (core/object/object.cpp:2284)
Leaked instance: GDScriptNativeClass:9223372053128676140
Leaked instance: GDScript:9223372066986657055 - Resource path: res://Entity/base/stats func/StatFunc.gd
Leaked instance: GDScript:9223372069318690082 - Resource path: res://GlobalRes/GbFunc.gd
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
ERROR: 2 resources still in use at exit.
at: clear (core/io/resource.cpp:599)
Resource still in use: res://Entity/base/stats func/StatFunc.gd (GDScript)
Resource still in use: res://GlobalRes/GbFunc.gd (GDScript).```