summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2003-01-17 15:53:42 +0000
committerJon Trowbridge <trow@src.gnome.org>2003-01-17 15:53:42 +0000
commitf66caf172d83c021c3af5f224c6ccc9450724e68 (patch)
tree236efbdd234e0b93a05b472177fb2b0edd65be6c
parent56e35a4e8917b0b9b49fa0ba2bc114c44660a4e7 (diff)
downloadpygobject-f66caf172d83c021c3af5f224c6ccc9450724e68.tar.gz
pygobject-f66caf172d83c021c3af5f224c6ccc9450724e68.tar.xz
pygobject-f66caf172d83c021c3af5f224c6ccc9450724e68.zip
In my fix for bug #102756 on 2003-01-08, I should have used calls to
2003-01-17 Jon Trowbridge <trow@ximian.com> * pygobject.c (pygobject_dealloc): In my fix for bug #102756 on 2003-01-08, I should have used calls to pyg_unblock_threads()/ pyg_block_threads() instead of directly calling the Py_BEGIN_ALLOW_THREADS/Py_END_ALLOW_THREADS macros. The macros don't update our local thread lock counts, causing problems in cases where the finalization of one object triggers the finalization of another. (When I say "problems", I of course mean "horrible crashes and mysterious race conditions".) * gtk/gtk-types.c (pygtk_style_helper_dealloc, pygtk_style_helper_setitem, pygtk_tree_model_row_dealloc, pygtk_tree_model_row_iter_dealloc): See above.
-rw-r--r--gobject/pygobject.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c
index 3affe46..207702e 100644
--- a/gobject/pygobject.c
+++ b/gobject/pygobject.c
@@ -216,10 +216,10 @@ pygobject_dealloc(PyGObject *self)
self->hasref = TRUE;
g_object_set_qdata_full(obj, pygobject_ownedref_key,
self, pyg_destroy_notify);
-
- Py_BEGIN_ALLOW_THREADS;
+
+ pyg_unblock_threads();
g_object_unref(obj);
- Py_END_ALLOW_THREADS;
+ pyg_block_threads();
/* we ref the type, so subtype_dealloc() doesn't kill off our
* instance's type. */
@@ -235,9 +235,9 @@ pygobject_dealloc(PyGObject *self)
return;
}
if (obj && !self->hasref) { /* don't unref the GObject if it owns us */
- Py_BEGIN_ALLOW_THREADS;
+ pyg_unblock_threads();
g_object_unref(obj);
- Py_END_ALLOW_THREADS;
+ pyg_block_threads();
}
PyObject_ClearWeakRefs((PyObject *)self);