GridMapEditorPlgn: fix a leak

(cherry picked from commit 5cf331588a)
This commit is contained in:
Poommetee Ketson 2018-02-27 21:26:39 +07:00 committed by Hein-Pieter van Braam
parent e6200de73a
commit 3e1716b2c3
1 changed files with 3 additions and 2 deletions

View File

@ -1259,9 +1259,10 @@ GridMapEditor::~GridMapEditor() {
VisualServer::get_singleton()->free(grid_instance[i]); VisualServer::get_singleton()->free(grid_instance[i]);
if (cursor_instance.is_valid()) if (cursor_instance.is_valid())
VisualServer::get_singleton()->free(cursor_instance); VisualServer::get_singleton()->free(cursor_instance);
if (selection_level_instance[i].is_valid()) { if (selection_level_instance[i].is_valid())
VisualServer::get_singleton()->free(selection_level_instance[i]); VisualServer::get_singleton()->free(selection_level_instance[i]);
} if (selection_level_mesh[i].is_valid())
VisualServer::get_singleton()->free(selection_level_mesh[i]);
} }
VisualServer::get_singleton()->free(selection_mesh); VisualServer::get_singleton()->free(selection_mesh);