summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-10-04 19:37:11 +0200
committerkobewi <kobewi4e@gmail.com>2022-10-04 20:13:01 +0200
commit52435e6f90be3753b365ec48a032900f0ccdd94d (patch)
tree4b2ac9f57a6fe0c2e5c3c47ce1ab781984441489 /editor
parent0056acf46fc88757cae9d9f6fe9805f0eec1cd09 (diff)
Disconnect TileSet from source editor if no sources
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/tiles/tile_set_atlas_source_editor.cpp7
1 files changed, 7 insertions, 0 deletions
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<TileSet>();
+ return;
+ }
+
tile_set_changed_needs_update = true;
}