[pygobject] Add GIL safety to pyobject_copy for copying boxed PyObjects



commit a15333a36e31b76ea6b80251553840269ec5deb1
Author: Simon Feltman <sfeltman src gnome org>
Date:   Sat Jul 6 13:34:13 2013 -0700

    Add GIL safety to pyobject_copy for copying boxed PyObjects
    
    https://bugzilla.gnome.org/show_bug.cgi?id=688081

 gi/_gobject/pygobject.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gi/_gobject/pygobject.c b/gi/_gobject/pygobject.c
index 875da17..126c80e 100644
--- a/gi/_gobject/pygobject.c
+++ b/gi/_gobject/pygobject.c
@@ -2386,8 +2386,11 @@ static gpointer
 pyobject_copy(gpointer boxed)
 {
     PyObject *object = boxed;
+    PyGILState_STATE state;
 
+    state = pyglib_gil_state_ensure();
     Py_INCREF(object);
+    pyglib_gil_state_release(state);
     return object;
 }
 



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