Skip to content

Commit

Permalink
imgui: avoid brutal exit when selecting exit in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
fredroy committed Jan 6, 2025
1 parent c00745e commit 60ccfde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void ImGuiGUIEngine::loadFile(sofaglfw::SofaGLFWBaseGUI* baseGUI, sofa::core::sp
if( !groot )
groot = sofa::simulation::getSimulation()->createNewGraph("");
baseGUI->setSimulation(groot, filePathName);

sofa::simulation::node::initRoot(groot.get());
auto camera = baseGUI->findCamera(groot);
if (camera)
Expand Down Expand Up @@ -357,8 +357,8 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI)
ImGui::Separator();
if (ImGui::MenuItem("Exit"))
{
//TODO: brutal exit, need to clean up everything (simulation, window, opengl, imgui etc)
exit(EXIT_SUCCESS);
this->terminate();
return;
}
ImGui::EndMenu();
}
Expand Down

0 comments on commit 60ccfde

Please sign in to comment.