mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Merge pull request #82171 from timothyqiu/sep-leak
Fix leak when calling `remove_control_from_menu_panel`
This commit is contained in:
commit
04317bc784
@ -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 New Issue
Block a user