[pygobject] take GIL in _pygi_invoke_closure_free (bug #647016)



commit 3e64a62d6d7f9e9d2820aad54187ef9c34710a1f
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Apr 7 21:05:32 2011 +1000

    take GIL in _pygi_invoke_closure_free (bug #647016)

 gi/pygi-closure.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gi/pygi-closure.c b/gi/pygi-closure.c
index 35281a2..f770b20 100644
--- a/gi/pygi-closure.c
+++ b/gi/pygi-closure.c
@@ -392,8 +392,10 @@ end:
 
 void _pygi_invoke_closure_free (gpointer data)
 {
+    PyGILState_STATE state;
     PyGICClosure* invoke_closure = (PyGICClosure *) data;
 
+    state = PyGILState_Ensure();
     Py_DECREF (invoke_closure->function);
 
     g_callable_info_free_closure (invoke_closure->info,
@@ -403,6 +405,7 @@ void _pygi_invoke_closure_free (gpointer data)
         g_base_info_unref ( (GIBaseInfo*) invoke_closure->info);
 
     Py_XDECREF (invoke_closure->user_data);
+    PyGILState_Release (state);
 
     g_slice_free (PyGICClosure, invoke_closure);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]