Merge pull request #66953 from Sauermann/fix-top-level-connect-error

Fix Control node not disconnecting from signal
This commit is contained in:
Rémi Verschelde 2022-10-13 09:04:25 +02:00
commit fad0327503

View file

@ -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));