Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions editor/plugins/editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Button *EditorPlugin::add_control_to_bottom_panel(Control *p_control, const Stri
void EditorPlugin::add_control_to_dock(DockSlot p_slot, Control *p_control, const Ref<Shortcut> &p_shortcut) {
ERR_FAIL_NULL(p_control);
ERR_FAIL_COND(legacy_docks.has(p_control));
ERR_FAIL_COND(p_control->get_parent() != nullptr);

EditorDock *dock = memnew(EditorDock);
dock->set_title(p_control->get_name());
Expand All @@ -108,6 +109,9 @@ void EditorPlugin::remove_control_from_docks(Control *p_control) {
ERR_FAIL_NULL(p_control);
ERR_FAIL_COND(!legacy_docks.has(p_control));

// Ensure freeing the legacy dock won't free `p_control` (freeing it is up to the user).
legacy_docks[p_control]->remove_child(p_control);

EditorDockManager::get_singleton()->remove_dock(legacy_docks[p_control]);
legacy_docks[p_control]->queue_free();
legacy_docks.erase(p_control);
Expand Down
Loading