diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-29 16:51:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-29 16:51:15 +0200 |
commit | 4ca22d81d71afb87500f9dbdc56791365f656b7a (patch) | |
tree | d6d9b9321f063f817481df39f0b713ef06ea67b4 | |
parent | 19c780b0ed6cbe78ad56f9cf70176ac5e3ff7813 (diff) | |
parent | 67b58de0f84e3fcf25855fdd523d10b8d81f7022 (diff) |
Merge pull request #30156 from qarmin/fix_memory_leak_in_tilemap
Fix memory leak in Tilemaps
-rw-r--r-- | editor/plugins/tile_set_editor_plugin.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 069d9d25ee..35cfdf15be 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -974,6 +974,7 @@ void TileSetEditor::_on_workspace_draw() { workspace->draw_rect(region, c, false); } } + delete tiles; if (edit_mode == EDITMODE_REGION) { if (workspace_mode != WORKSPACE_EDIT) { @@ -1068,6 +1069,7 @@ void TileSetEditor::_on_workspace_overlay_draw() { c = Color(0.1, 0.1, 0.1); workspace_overlay->draw_string(font, region.position, tile_id_name, c); } + delete tiles; } int t_id = get_current_tile(); @@ -1115,10 +1117,12 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &p_ie) { set_current_tile(t_id); workspace->update(); workspace_overlay->update(); + delete tiles; return; } } } + delete tiles; } } @@ -3118,6 +3122,7 @@ void TileSetEditor::update_workspace_minsize() { workspace_min_size.y = region.position.y + region.size.y; } } + delete tiles; workspace->set_custom_minimum_size(workspace_min_size + WORKSPACE_MARGIN * 2); workspace_container->set_custom_minimum_size(workspace_min_size + WORKSPACE_MARGIN * 2); |