[pygobject/pygobject-3-4] Fix crash with GLib.child_watch_add
- From: Martin Pitt <martinpitt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/pygobject-3-4] Fix crash with GLib.child_watch_add
- Date: Mon, 12 Nov 2012 06:29:29 +0000 (UTC)
commit a06e0d021d74c95cd517abb3e6ef5ff0037de679
Author: Daniel Narvaez <dwnarvaez gmail com>
Date: Sun Nov 11 00:51:12 2012 +0100
Fix crash with GLib.child_watch_add
Was sometimes crashing when the destroy notify was called.
https://bugzilla.gnome.org/show_bug.cgi?id=688067
gi/_glib/glibmodule.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gi/_glib/glibmodule.c b/gi/_glib/glibmodule.c
index 4dea68c..7d70a07 100644
--- a/gi/_glib/glibmodule.c
+++ b/gi/_glib/glibmodule.c
@@ -351,9 +351,15 @@ static void
child_watch_dnotify(gpointer data)
{
struct _PyGChildData *child_data = (struct _PyGChildData *) data;
+ PyGILState_STATE gil;
+
+ gil = pyglib_gil_state_ensure();
+
Py_DECREF(child_data->func);
Py_XDECREF(child_data->data);
g_slice_free(struct _PyGChildData, child_data);
+
+ pyglib_gil_state_release(gil);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]