diff --git a/src/Main/FreeCADGuiPy.cpp b/src/Main/FreeCADGuiPy.cpp index a83090faf5..0e074d266e 100644 --- a/src/Main/FreeCADGuiPy.cpp +++ b/src/Main/FreeCADGuiPy.cpp @@ -326,7 +326,10 @@ PyMOD_INIT_FUNC(FreeCADGui) App::Application::Config()["AppIcon"] = "freecad"; App::Application::Config()["SplashScreen"] = "freecadsplash"; App::Application::Config()["CopyrightInfo"] = "\xc2\xa9 Juergen Riegel, Werner Mayer, Yorik van Havre 2001-2017\n"; - Gui::Application::initApplication(); + // it's possible that the GUI is already initialized when the Gui version of the executable + // is started in command mode + if (Base::Type::fromName("Gui::BaseView").isBad()) + Gui::Application::initApplication(); #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef FreeCADGuiModuleDef = { PyModuleDef_HEAD_INIT,