diff options
| author | Jon Trowbridge <trow@ximian.com> | 2003-03-04 16:23:25 +0000 |
|---|---|---|
| committer | Jon Trowbridge <trow@src.gnome.org> | 2003-03-04 16:23:25 +0000 |
| commit | 8febf0d579f67b16d347c8c91c69bd7afe3f4034 (patch) | |
| tree | 09d770dc3fbb65f79b7655a0c986285e65eab351 /gobject/pygobject.c | |
| parent | ff0a57537a0472e970277b18ee8c2b02844c12c0 (diff) | |
| download | pygobject-8febf0d579f67b16d347c8c91c69bd7afe3f4034.tar.gz pygobject-8febf0d579f67b16d347c8c91c69bd7afe3f4034.tar.xz pygobject-8febf0d579f67b16d347c8c91c69bd7afe3f4034.zip | |
Unblock threads before invalidating our closures, since this might trigger
2003-03-04 Jon Trowbridge <trow@ximian.com>
* pygobject.c (pygobject_dealloc): Unblock threads before
invalidating our closures, since this might trigger a destructor
that needs to execute python code.
(pygobject_clear): Ditto.
* pygboxed.c (pyg_boxed_dealloc): Unblock threads before freeing
the boxed type, since the destructor may need to execute python
code.
(pyg_boxed_new): Block threads while we make our Py* calls.
(pyg_pointer_new): Block threads while we make our Py* calls.
* gobjectmodule.c (pyg_object_set_property): We need to block
threads before our call to pygobject_new.
(pyg_object_get_property): Ditto.
Diffstat (limited to 'gobject/pygobject.c')
| -rw-r--r-- | gobject/pygobject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c index 207702e..29c803d 100644 --- a/gobject/pygobject.c +++ b/gobject/pygobject.c @@ -249,6 +249,7 @@ pygobject_dealloc(PyGObject *self) } self->inst_dict = NULL; + pyg_unblock_threads(); tmp = self->closures; while (tmp) { GClosure *closure = tmp->data; @@ -259,6 +260,7 @@ pygobject_dealloc(PyGObject *self) g_closure_invalidate(closure); } self->closures = NULL; + pyg_block_threads(); /* the following causes problems with subclassed types */ /*self->ob_type->tp_free((PyObject *)self); */ @@ -321,6 +323,7 @@ pygobject_clear(PyGObject *self) { GSList *tmp; + pyg_unblock_threads(); tmp = self->closures; while (tmp) { GClosure *closure = tmp->data; @@ -330,6 +333,7 @@ pygobject_clear(PyGObject *self) tmp = tmp->next; g_closure_invalidate(closure); } + pyg_block_threads(); if (self->closures != NULL) g_message("invalidated all closures, but self->closures != NULL !"); |
