From 47752e0d240d9f2686c2a69d813ac5112bda1ad3 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Sun, 16 Aug 2020 10:05:08 -0600 Subject: [PATCH] Hold the GIL while deleting python objects --- fract4d/c/fract4dc/calcs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fract4d/c/fract4dc/calcs.cpp b/fract4d/c/fract4dc/calcs.cpp index 2c8910eed..1509e8d99 100644 --- a/fract4d/c/fract4dc/calcs.cpp +++ b/fract4d/c/fract4dc/calcs.cpp @@ -94,7 +94,9 @@ void * calculation_thread(calc_args *args) #ifdef DEBUG_THREADS std::cerr << args << " : CA : ENDCALC(" << std::this_thread::get_id() << ")\n"; #endif + PyGILState_STATE gstate = PyGILState_Ensure(); delete args; + PyGILState_Release(gstate); return NULL; }