From 6e920d0c14173ae8276d7bb3b42d608a7480377f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 10 May 2021 15:07:14 +0200 Subject: [PATCH] TileSet: Fix signal disconnect error in some situation Fixes second issue in #45938. Co-authored-by: kleonc <9283098+kleonc@users.noreply.github.com> --- editor/plugins/tile_set_editor_plugin.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index db983e57458..f9d57bc8316 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -3602,11 +3602,15 @@ void TileSetEditorPlugin::make_visible(bool p_visible) { if (p_visible) { tileset_editor_button->show(); editor->make_bottom_panel_item_visible(tileset_editor); - get_tree()->connect("idle_frame", tileset_editor, "_on_workspace_process"); + if (!get_tree()->is_connected("idle_frame", tileset_editor, "_on_workspace_process")) { + get_tree()->connect("idle_frame", tileset_editor, "_on_workspace_process"); + } } else { editor->hide_bottom_panel(); tileset_editor_button->hide(); - get_tree()->disconnect("idle_frame", tileset_editor, "_on_workspace_process"); + if (get_tree()->is_connected("idle_frame", tileset_editor, "_on_workspace_process")) { + get_tree()->disconnect("idle_frame", tileset_editor, "_on_workspace_process"); + } } }