From 04705d2899322ff7a8b3c75cb0822d25c60a544c Mon Sep 17 00:00:00 2001 From: maidopi-usagi Date: Sat, 27 Jul 2024 01:34:03 +0800 Subject: [PATCH] Fix leaked signal connection to connection_layer. --- scene/gui/graph_edit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 55a2c607e3d..9b762f7b3c4 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -695,6 +695,10 @@ void GraphEdit::remove_child_notify(Node *p_child) { graph_element->disconnect("raise_request", callable_mp(this, &GraphEdit::_ensure_node_order_from)); graph_element->disconnect("resize_request", callable_mp(this, &GraphEdit::_graph_element_resize_request)); + if (connections_layer != nullptr && connections_layer->is_inside_tree()) { + graph_element->disconnect(SceneStringName(item_rect_changed), callable_mp((CanvasItem *)connections_layer, &CanvasItem::queue_redraw)); + } + // In case of the whole GraphEdit being destroyed these references can already be freed. if (minimap != nullptr && minimap->is_inside_tree()) { graph_element->disconnect(SceneStringName(item_rect_changed), callable_mp((CanvasItem *)minimap, &GraphEditMinimap::queue_redraw));