From 349f8b5ff9b5f6db95b4b0395a67d2f6cc40362a Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 10 Jul 2017 20:51:30 +0200 Subject: [PATCH] avoid to eventually try to init Gui twice --- src/Main/FreeCADGuiPy.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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,