Fixes crash in caused by calling ColorPickerButton.propagate_notification(33)
This commit is contained in:
parent
62f56af694
commit
35eeafdb0c
1 changed files with 9 additions and 3 deletions
|
@ -525,7 +525,9 @@ void Control::_notification(int p_notification) {
|
||||||
data.SI = get_viewport()->_gui_add_subwindow_control(this);
|
data.SI = get_viewport()->_gui_add_subwindow_control(this);
|
||||||
} else {
|
} else {
|
||||||
//is a regular root control
|
//is a regular root control
|
||||||
data.RI = get_viewport()->_gui_add_root_control(this);
|
Viewport *viewport = get_viewport();
|
||||||
|
ERR_FAIL_COND(!viewport);
|
||||||
|
data.RI = viewport->_gui_add_root_control(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
data.parent_canvas_item = get_parent_item();
|
data.parent_canvas_item = get_parent_item();
|
||||||
|
@ -534,7 +536,9 @@ void Control::_notification(int p_notification) {
|
||||||
data.parent_canvas_item->connect("item_rect_changed", this, "_size_changed");
|
data.parent_canvas_item->connect("item_rect_changed", this, "_size_changed");
|
||||||
} else {
|
} else {
|
||||||
//connect viewport
|
//connect viewport
|
||||||
get_viewport()->connect("size_changed", this, "_size_changed");
|
Viewport *viewport = get_viewport();
|
||||||
|
ERR_FAIL_COND(!viewport);
|
||||||
|
viewport->connect("size_changed", this, "_size_changed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -552,7 +556,9 @@ void Control::_notification(int p_notification) {
|
||||||
data.parent_canvas_item = nullptr;
|
data.parent_canvas_item = nullptr;
|
||||||
} else if (!is_set_as_toplevel()) {
|
} else if (!is_set_as_toplevel()) {
|
||||||
//disconnect viewport
|
//disconnect viewport
|
||||||
get_viewport()->disconnect("size_changed", this, "_size_changed");
|
Viewport *viewport = get_viewport();
|
||||||
|
ERR_FAIL_COND(!viewport);
|
||||||
|
viewport->disconnect("size_changed", this, "_size_changed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.MI) {
|
if (data.MI) {
|
||||||
|
|
Loading…
Reference in a new issue