summaryrefslogtreecommitdiffstats
path: root/gobject/gobjectmodule.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2003-03-04 16:23:25 +0000
committerJon Trowbridge <trow@src.gnome.org>2003-03-04 16:23:25 +0000
commit8febf0d579f67b16d347c8c91c69bd7afe3f4034 (patch)
tree09d770dc3fbb65f79b7655a0c986285e65eab351 /gobject/gobjectmodule.c
parentff0a57537a0472e970277b18ee8c2b02844c12c0 (diff)
downloadpygobject-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/gobjectmodule.c')
-rw-r--r--gobject/gobjectmodule.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index bd3b727..f9eb627 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -622,10 +622,14 @@ pyg_object_set_property (GObject *object, guint property_id,
PyObject *object_wrapper, *retval;
PyObject *py_pspec, *py_value;
+ pyg_block_threads();
+
object_wrapper = pygobject_new(object);
- g_return_if_fail(object_wrapper != NULL);
- pyg_block_threads();
+ if (object_wrapper == NULL) {
+ pyg_unblock_threads();
+ g_return_if_fail(object_wrapper != NULL);
+ }
py_pspec = pyg_param_spec_new(pspec);
py_value = pyg_value_as_pyobject (value, TRUE);
@@ -653,10 +657,14 @@ pyg_object_get_property (GObject *object, guint property_id,
PyObject *object_wrapper, *retval;
PyObject *py_pspec;
+ pyg_block_threads();
+
object_wrapper = pygobject_new(object);
- g_return_if_fail(object_wrapper != NULL);
- pyg_block_threads();
+ if (object_wrapper == NULL) {
+ pyg_unblock_threads();
+ g_return_if_fail(object_wrapper != NULL);
+ }
py_pspec = pyg_param_spec_new(pspec);
retval = PyObject_CallMethod(object_wrapper, "do_get_property",