From 52435e6f90be3753b365ec48a032900f0ccdd94d Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 4 Oct 2022 19:37:11 +0200 Subject: Disconnect TileSet from source editor if no sources --- editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'editor/plugins/tiles') diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 45b2a5eb14..4299ae8d3e 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -2043,6 +2043,13 @@ void TileSetAtlasSourceEditor::_tile_alternatives_control_unscaled_draw() { } void TileSetAtlasSourceEditor::_tile_set_changed() { + if (tile_set->get_source_count() == 0) { + // No sources, so nothing to do here anymore. + tile_set->disconnect("changed", callable_mp(this, &TileSetAtlasSourceEditor::_tile_set_changed)); + tile_set = Ref(); + return; + } + tile_set_changed_needs_update = true; } -- cgit v1.2.3