Mesh: handle exceptions when running FreeCAD in headless mode
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
# include <Inventor/SoInput.h>
|
||||
# include <Inventor/nodes/SoSeparator.h>
|
||||
# include <Inventor/annex/ForeignFiles/SoSTLFileKit.h>
|
||||
# include <QApplication>
|
||||
#endif
|
||||
|
||||
#include <Base/Interpreter.h>
|
||||
@@ -147,7 +148,9 @@ PyMOD_INIT_FUNC(MeshGui)
|
||||
|
||||
// instantiating the commands
|
||||
CreateMeshCommands();
|
||||
(void)new MeshGui::CleanupHandler;
|
||||
if (qApp) {
|
||||
(void)new MeshGui::CleanupHandler;
|
||||
}
|
||||
|
||||
// try to instantiate flat-mesh commands
|
||||
try{
|
||||
|
||||
@@ -117,3 +117,6 @@ try:
|
||||
except ImportError:
|
||||
App.Console.PrintLog("flatmesh-commands are not available\n")
|
||||
App.Console.PrintLog("flatmesh needs pybind11 as build dependency\n")
|
||||
except AttributeError:
|
||||
# Can happen when running FreeCAD in headless mode
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user