diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-10-13 14:04:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-13 14:04:11 +0200 |
commit | 8240a11ba0aeddceb7d815354969e29b3bd385a6 (patch) | |
tree | f2e8b4ea05ceb0f1a46580990c4156e6efd7844a /scene | |
parent | f86fd80f30b7c85fc789ca1cf9ff75c1280d34b9 (diff) | |
parent | 48fb43035cdece5629db4966153144ab35467b4d (diff) |
Merge pull request #53761 from groud/fix_tilemap_memory_leak
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/tile_map.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 42c54a950d..050168f9d9 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -811,8 +811,9 @@ void TileMap::_rendering_cleanup_layer(int p_layer) { ERR_FAIL_INDEX(p_layer, (int)layers.size()); RenderingServer *rs = RenderingServer::get_singleton(); - if (!layers[p_layer].canvas_item.is_valid()) { + if (layers[p_layer].canvas_item.is_valid()) { rs->free(layers[p_layer].canvas_item); + layers[p_layer].canvas_item = RID(); } } |