1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-19 14:31:59 +00:00

Merge pull request #80607 from lawnjelly/fix_tileset_signal_crash

Fix crash on exit where `TileSet` calls destroyed `TileSetAtlasSourceEditor`
This commit is contained in:
Rémi Verschelde
2023-08-14 15:30:32 +02:00

View File

@@ -2655,6 +2655,12 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() {
TileSetAtlasSourceEditor::~TileSetAtlasSourceEditor() { TileSetAtlasSourceEditor::~TileSetAtlasSourceEditor() {
memdelete(tile_proxy_object); memdelete(tile_proxy_object);
memdelete(atlas_source_proxy_object); memdelete(atlas_source_proxy_object);
// Remove listener for old objects, so the TileSet doesn't
// try to call the destroyed TileSetAtlasSourceEditor.
if (tile_set.is_valid()) {
tile_set->disconnect_changed(callable_mp(this, &TileSetAtlasSourceEditor::_tile_set_changed));
}
} }
////// EditorPropertyTilePolygon ////// ////// EditorPropertyTilePolygon //////