Gut icon indicating copy to clipboard operation
Gut copied to clipboard

ObjectDB instances leaked: Label/HBoxContainer

Open Poobslag opened this issue 3 years ago • 1 comments

After upgrading from Gut 7.1.0 to Gut 7.2.0, I get an ObjectDB instances leaked at exit error when closing the editor window.

This occurs in Godot 3.5 when launching the editor in Windows using the Godot_v3.5-stable_win64_console.cmd command. Appending the --verbose flag yields the following output:

Godot Engine v3.5.stable.official.991bb6ac7 - https://godotengine.org
OpenGL ES 3.0 Renderer: NVIDIA GeForce GTX 970/PCIe/SSE2
Async. shader compilation: OFF

EditorSettings: Save OK!
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object.cpp:2070)
Leaked instance: Label:20853 - Node name: Label
Leaked instance: HBoxContainer:20852 - Node name:
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
Orphan StringName: Label
Orphan StringName: HBoxContainer
Orphan StringName: visibility_changed
Orphan StringName: minimum_size_changed
Orphan StringName: size_flags_changed
Orphan StringName: queue_sort
Orphan StringName: _child_minsize_changed
StringName: 7 unclaimed string names at exit.

Poobslag avatar Sep 04 '22 11:09 Poobslag

I have worked around the problem with the following patch. This patch breaks encapsulation, but presumably you want to do something similar in a nicer way

diff --git a/project/addons/gut/gut_plugin.gd b/project/addons/gut/gut_plugin.gd
index e2c3c8b6..4c28122a 100644
--- a/project/addons/gut/gut_plugin.gd
+++ b/project/addons/gut/gut_plugin.gd
@@ -24,4 +24,6 @@ func _exit_tree():
 	# Always remember to remove it from the engine when deactivated
 	remove_custom_type("Gut")
 	remove_control_from_bottom_panel(_bottom_panel)
+	if _bottom_panel._gut_config_gui and _bottom_panel._gut_config_gui._base_control:
+		_bottom_panel._gut_config_gui._base_control.free()
 	_bottom_panel.free()

Poobslag avatar Sep 04 '22 11:09 Poobslag