diff --git a/haxelib/haxeui.zip b/haxelib/haxeui.zip index 87186a06..e62f1a9c 100644 Binary files a/haxelib/haxeui.zip and b/haxelib/haxeui.zip differ diff --git a/src/haxe/ui/toolkit/console/HaxeUIConsoleFunctions.hx b/src/haxe/ui/toolkit/console/HaxeUIConsoleFunctions.hx index 8cfe3ea9..77d20cf6 100644 --- a/src/haxe/ui/toolkit/console/HaxeUIConsoleFunctions.hx +++ b/src/haxe/ui/toolkit/console/HaxeUIConsoleFunctions.hx @@ -64,6 +64,7 @@ class HaxeUIConsoleFunctions { public static function dispose(target:Dynamic):Void { var c:Component = getComponent(target); if (c != null) { + unregisterObjects(c); c.parent.removeChild(c); } } @@ -255,4 +256,18 @@ class HaxeUIConsoleFunctions { HaxeUIConsole.scripts.set(scriptRes, scriptData); DC.logConfirmation("Script '" + scriptRes + "' saved"); } + + private static function unregisterObjects(parent:Component):Void { + if (parent == null) { + return; + } + + if (parent.id != null) { + DC.unregisterObject(parent.id); + } + + for (child in parent.children) { + unregisterObjects(cast child); + } + } } \ No newline at end of file