diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-13 09:04:25 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-13 09:04:25 +0200 |
commit | fad03275030a61f0ecb9d4b5723e41b48b165948 (patch) | |
tree | fdc117c814e0b97e98a2aead0432922d398f9da0 /scene/gui | |
parent | 40847f14364a171d46ad287e8f296b60546d67d2 (diff) | |
parent | c0f0f26615990ae90112b94313869f06124f2c13 (diff) |
Merge pull request #66953 from Sauermann/fix-top-level-connect-error
Fix Control node not disconnecting from signal
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/control.cpp | 4 |
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)); |