Skip to content

Dockbuilder Segmentation Fault #3203

@Isam-Ilyas29

Description

@Isam-Ilyas29

Information:

Version: 1.76 WIP
Branch: docking

Back-ends: imgui_impl_opengl3.cpp + imgui_impl_glfw.cpp
Compiler: gcc
Operating System: linux, manjaro

My Issue/Question:

I seem to get a segmentation fault when executing this code multiple times during runtime:

if (ImGui::MenuItem("Default Layout")) { 
	ImGui::DockBuilderRemoveNode(mDockspaceID);
	ImGui::DockBuilderAddNode(mDockspaceID, ImGuiDockNodeFlags_None);
	ImGui::DockBuilderSetNodeSize(mDockspaceID, ImGui::GetMainViewport()->Size);

	ImGuiID dock_main = mDockspaceID;
	ImGuiID dock_right = ImGui::DockBuilderSplitNode(dock_main, ImGuiDir_Right, 0.3f, nullptr, &dock_main);
	ImGuiID dock_down = ImGui::DockBuilderSplitNode(dock_main, ImGuiDir_Down, 0.3f, nullptr, &dock_main);

	ImGui::DockBuilderDockWindow("Profiler##profiler1", dock_main);
	ImGui::DockBuilderDockWindow("Scene##scene1", dock_main);
	ImGui::DockBuilderDockWindow("Editor##editor1", dock_right);
	ImGui::DockBuilderDockWindow("Console##console1", dock_down);
	ImGui::DockBuilderDockWindow("Log##logger1", dock_down);
	ImGui::DockBuilderFinish(mDockspaceID);
}

The callstack

Full function:
The full function can be found here and to clarify, I call this function before creating any of the windows in the current frame.
https://hastebin.com/wayiroriwo.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions