From b2ad8d79de532c5d8fb5a45fc91023db57287565 Mon Sep 17 00:00:00 2001 From: marioalexis Date: Wed, 27 Aug 2025 01:53:34 -0300 Subject: [PATCH] Fem: Acquire the GIL before running Python code --- src/Mod/Fem/App/FemMesh.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Mod/Fem/App/FemMesh.cpp b/src/Mod/Fem/App/FemMesh.cpp index ffd8e2bbfb..7306b465d3 100644 --- a/src/Mod/Fem/App/FemMesh.cpp +++ b/src/Mod/Fem/App/FemMesh.cpp @@ -1533,6 +1533,7 @@ void FemMesh::readAbaqus(const std::string& FileName) 'Mod/Fem/femtest/data/mesh/tetra10_mesh.inp') */ + Base::PyGILStateLocker lock; PyObject* module = PyImport_ImportModule("feminout.importInpMesh"); if (!module) { return; @@ -1573,6 +1574,7 @@ void FemMesh::readZ88(const std::string& FileName) 'Mod/Fem/femtest/data/mesh/tetra10_mesh.z88') */ + Base::PyGILStateLocker lock; PyObject* module = PyImport_ImportModule("feminout.importZ88Mesh"); if (!module) { return; @@ -2236,6 +2238,7 @@ void FemMesh::writeZ88(const std::string& FileName) const feminout.importZ88Mesh.write(App.ActiveDocument.Box_Mesh.FemMesh, '/tmp/mesh.z88') */ + Base::PyGILStateLocker lock; PyObject* module = PyImport_ImportModule("feminout.importZ88Mesh"); if (!module) { return;