diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-12 11:41:49 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-12 11:41:49 +0100 |
commit | 52a0bba83311ca33113c2c056120a00b30dccccb (patch) | |
tree | 6a89f278c24ba2b76834486c1d1244dad654ffaf | |
parent | 9562cfbf4b3bb3a1f4c21253e880d16b008830c8 (diff) | |
parent | e7fb2f029419f548b9df80c046005933384741ad (diff) |
Merge pull request #69922 from adamscott/fix-tilemap-tileset-heap-use-after-free
Fix `heap-use-after-free` error in `TileMap::~TileMap()`
-rw-r--r-- | scene/2d/tile_map.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 13474eb829..61f45114de 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -4090,5 +4090,9 @@ TileMap::TileMap() { } TileMap::~TileMap() { + if (tile_set.is_valid()) { + tile_set->disconnect("changed", callable_mp(this, &TileMap::_tile_set_changed)); + } + _clear_internals(); } |