From 70be6848c251e04ef864fa2a75da15371bdc6828 Mon Sep 17 00:00:00 2001 From: Poommetee Ketson Date: Mon, 22 Jan 2018 11:46:05 +0700 Subject: [PATCH] Fix ObjectDB Instances still exist ``` WARNING: cleanup: ObjectDB Instances still exist! At: core/object.cpp:1989. Leaked Instance: VSeparator:13837 - Node Name: Leaked Instance: AutotileEditorHelper:13814 Orphan StringName: VSeparator Orphan StringName: AutotileEditorHelper StringName: 2 unclaimed string names at exit. ``` --- editor/plugins/tile_set_editor_plugin.cpp | 6 +++++- editor/plugins/tile_set_editor_plugin.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 1dedf92452e..dd5127181d7 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -420,7 +420,7 @@ AutotileEditor::AutotileEditor(EditorNode *p_editor) { p.push_back((int)SHAPE_DELETE); tools[SHAPE_DELETE]->connect("pressed", this, "_on_tool_clicked", p); tool_containers[TOOLBAR_SHAPE]->add_child(tools[SHAPE_DELETE]); - tool_containers[TOOLBAR_SHAPE]->add_change_receptor(memnew(VSeparator)); + tool_containers[TOOLBAR_SHAPE]->add_child(memnew(VSeparator)); tools[SHAPE_KEEP_INSIDE_TILE] = memnew(ToolButton); tools[SHAPE_KEEP_INSIDE_TILE]->set_toggle_mode(true); tools[SHAPE_KEEP_INSIDE_TILE]->set_pressed(true); @@ -548,6 +548,10 @@ AutotileEditor::AutotileEditor(EditorNode *p_editor) { preview->set_region(true); } +AutotileEditor::~AutotileEditor() { + memdelete(helper); +} + void AutotileEditor::_bind_methods() { ClassDB::bind_method("_on_autotile_selected", &AutotileEditor::_on_autotile_selected); diff --git a/editor/plugins/tile_set_editor_plugin.h b/editor/plugins/tile_set_editor_plugin.h index 93d403deea8..30f6e2b9251 100644 --- a/editor/plugins/tile_set_editor_plugin.h +++ b/editor/plugins/tile_set_editor_plugin.h @@ -120,6 +120,7 @@ class AutotileEditor : public Control { AutotileEditorHelper *helper; AutotileEditor(EditorNode *p_editor); + ~AutotileEditor(); protected: static void _bind_methods();