Make sure the GIL is held on cleanup

This commit is contained in:
Matthias Hochsteger 2024-06-25 17:13:32 +02:00
parent 32f291c66e
commit 73822401f1

View File

@ -13,6 +13,10 @@
#include "../libsrc/interface/writeuser.hpp" #include "../libsrc/interface/writeuser.hpp"
#ifdef NETGEN_PYTHON
#include <core/python_ngcore.hpp>
#endif
namespace netgen namespace netgen
{ {
DLL_HEADER extern Flags parameters; DLL_HEADER extern Flags parameters;
@ -251,6 +255,10 @@ int main(int argc, char ** argv)
// start event-loop // start event-loop
Tk_MainLoop(); Tk_MainLoop();
Tcl_DeleteInterp (myinterp); Tcl_DeleteInterp (myinterp);
#ifdef NETGEN_PYTHON
py::gil_scoped_acquire ensure_gil;
#endif
Tcl_Exit(0); Tcl_Exit(0);
} }