summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorAdam Scott <ascott.ca@gmail.com>2022-12-11 13:21:10 -0500
committerAdam Scott <ascott.ca@gmail.com>2022-12-12 04:52:00 -0500
commite7fb2f029419f548b9df80c046005933384741ad (patch)
treedcbb872d8339af6ddb433c7cb773336e75223e16 /scene
parent05097ded0a915cd6c083f15dab08da2bdc0770b8 (diff)
Fix `heap-use-after-free` error in `TileMap::~TileMap()`
Co-authored-by: Gilles Roudiere <gilles.roudiere@gmail.com>
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/tile_map.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 8b27dbe3db..06ec1d6eca 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -4072,5 +4072,9 @@ TileMap::TileMap() {
}
TileMap::~TileMap() {
+ if (tile_set.is_valid()) {
+ tile_set->disconnect("changed", callable_mp(this, &TileMap::_tile_set_changed));
+ }
+
_clear_internals();
}