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