2
0
Эх сурвалжийг харах

Merge pull request #17072 from Noshyaar/leak

TileSetEditorPlgn: Fix a leak
Rémi Verschelde 7 жил өмнө
parent
commit
9a37d423c2

+ 6 - 1
editor/plugins/tile_set_editor_plugin.cpp

@@ -401,7 +401,7 @@ void TileSetEditor::initialize_bottom_editor() {
 	p.push_back((int)SHAPE_DELETE);
 	p.push_back((int)SHAPE_DELETE);
 	tools[SHAPE_DELETE]->connect("pressed", this, "_on_tool_clicked", p);
 	tools[SHAPE_DELETE]->connect("pressed", this, "_on_tool_clicked", p);
 	tool_containers[TOOLBAR_SHAPE]->add_child(tools[SHAPE_DELETE]);
 	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] = memnew(ToolButton);
 	tools[SHAPE_KEEP_INSIDE_TILE]->set_toggle_mode(true);
 	tools[SHAPE_KEEP_INSIDE_TILE]->set_toggle_mode(true);
 	tools[SHAPE_KEEP_INSIDE_TILE]->set_pressed(true);
 	tools[SHAPE_KEEP_INSIDE_TILE]->set_pressed(true);
@@ -561,6 +561,11 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
 	initialize_bottom_editor();
 	initialize_bottom_editor();
 }
 }
 
 
+TileSetEditor::~TileSetEditor() {
+	if (helper)
+		memdelete(helper);
+}
+
 void TileSetEditor::_on_tile_list_selected(int p_index) {
 void TileSetEditor::_on_tile_list_selected(int p_index) {
 	if (get_current_tile() >= 0) {
 	if (get_current_tile() >= 0) {
 		current_item_index = p_index;
 		current_item_index = p_index;

+ 1 - 0
editor/plugins/tile_set_editor_plugin.h

@@ -155,6 +155,7 @@ public:
 	static Error update_library_file(Node *p_base_scene, Ref<TileSet> ml, bool p_merge = true);
 	static Error update_library_file(Node *p_base_scene, Ref<TileSet> ml, bool p_merge = true);
 
 
 	TileSetEditor(EditorNode *p_editor);
 	TileSetEditor(EditorNode *p_editor);
+	~TileSetEditor();
 
 
 private:
 private:
 	void _on_tile_list_selected(int p_index);
 	void _on_tile_list_selected(int p_index);