summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-13 09:04:25 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-10-13 09:04:25 +0200
commitfad03275030a61f0ecb9d4b5723e41b48b165948 (patch)
treefdc117c814e0b97e98a2aead0432922d398f9da0
parent40847f14364a171d46ad287e8f296b60546d67d2 (diff)
parentc0f0f26615990ae90112b94313869f06124f2c13 (diff)
Merge pull request #66953 from Sauermann/fix-top-level-connect-error
Fix Control node not disconnecting from signal
-rw-r--r--scene/gui/control.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 2dcae2553c..488ae762c5 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -2885,8 +2885,8 @@ void Control::_notification(int p_notification) {
if (data.parent_canvas_item) {
data.parent_canvas_item->disconnect("item_rect_changed", callable_mp(this, &Control::_size_changed));
data.parent_canvas_item = nullptr;
- } else if (!is_set_as_top_level()) {
- //disconnect viewport
+ } else {
+ // Disconnect viewport.
Viewport *viewport = get_viewport();
ERR_FAIL_COND(!viewport);
viewport->disconnect("size_changed", callable_mp(this, &Control::_size_changed));