Skip to content
Snippets Groups Projects
Commit e83a261e authored by AlQuemist's avatar AlQuemist
Browse files

App/main: finalize Python interpreter

parent 62eac1d6
No related branches found
No related tags found
1 merge request!2755Improve the construction of a 'Sample' from a Python script
...@@ -51,6 +51,10 @@ target_include_directories(${executable_name} PRIVATE ${CMAKE_SOURCE_DIR}) ...@@ -51,6 +51,10 @@ target_include_directories(${executable_name} PRIVATE ${CMAKE_SOURCE_DIR})
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# extra target properties # extra target properties
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
if(BORNAGAIN_PYTHON)
target_compile_definitions(${executable_name} PRIVATE -DBORNAGAIN_PYTHON)
endif()
if(WIN32) if(WIN32)
set_target_properties(${executable_name} PROPERTIES LINK_OPTIONS /ENTRY:mainCRTStartup) set_target_properties(${executable_name} PROPERTIES LINK_OPTIONS /ENTRY:mainCRTStartup)
if(win32_console) if(win32_console)
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "GUI/View/Base/Stylesheet.h" #include "GUI/View/Base/Stylesheet.h"
#include "GUI/View/Main/MainWindow.h" #include "GUI/View/Main/MainWindow.h"
#include "GUI/View/Widget/AppConfig.h" #include "GUI/View/Widget/AppConfig.h"
#include "PyCore/Embed/PyInterpreter.h" // PyInterpreter::finalize
#include "config_build.h" #include "config_build.h"
#include <QApplication> #include <QApplication>
#include <QDir> #include <QDir>
...@@ -82,5 +83,11 @@ int main(int argc, char* argv[]) ...@@ -82,5 +83,11 @@ int main(int argc, char* argv[])
win.show(); win.show();
ret = app.exec(); ret = app.exec();
#ifdef BORNAGAIN_PYTHON
std::cout << "BornAgain: finalize Python interpreter..." << std::endl;
PyInterpreter::finalize();
#endif // BORNAGAIN_PYTHON
return ret; return ret;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment