Merge pull request #82171 from timothyqiu/sep-leak
Fix leak when calling `remove_control_from_menu_panel`
This commit is contained in:
commit
04317bc784
2 changed files with 6 additions and 2 deletions
|
@ -4979,9 +4979,11 @@ void CanvasItemEditor::remove_control_from_menu_panel(Control *p_control) {
|
|||
|
||||
p_control->disconnect("visibility_changed", callable_mp(this, &CanvasItemEditor::_update_context_toolbar));
|
||||
|
||||
context_toolbar_hbox->remove_child(context_toolbar_separators[p_control]);
|
||||
VSeparator *sep = context_toolbar_separators[p_control];
|
||||
context_toolbar_hbox->remove_child(sep);
|
||||
context_toolbar_hbox->remove_child(p_control);
|
||||
context_toolbar_separators.erase(p_control);
|
||||
memdelete(sep);
|
||||
|
||||
_update_context_toolbar();
|
||||
}
|
||||
|
|
|
@ -7695,9 +7695,11 @@ void Node3DEditor::remove_control_from_menu_panel(Control *p_control) {
|
|||
|
||||
p_control->disconnect("visibility_changed", callable_mp(this, &Node3DEditor::_update_context_toolbar));
|
||||
|
||||
context_toolbar_hbox->remove_child(context_toolbar_separators[p_control]);
|
||||
VSeparator *sep = context_toolbar_separators[p_control];
|
||||
context_toolbar_hbox->remove_child(sep);
|
||||
context_toolbar_hbox->remove_child(p_control);
|
||||
context_toolbar_separators.erase(p_control);
|
||||
memdelete(sep);
|
||||
|
||||
_update_context_toolbar();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue