summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-13 14:04:11 +0200
committerGitHub <noreply@github.com>2021-10-13 14:04:11 +0200
commit8240a11ba0aeddceb7d815354969e29b3bd385a6 (patch)
treef2e8b4ea05ceb0f1a46580990c4156e6efd7844a /scene
parentf86fd80f30b7c85fc789ca1cf9ff75c1280d34b9 (diff)
parent48fb43035cdece5629db4966153144ab35467b4d (diff)
Merge pull request #53761 from groud/fix_tilemap_memory_leak
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/tile_map.cpp3
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();
}
}