diff options
author | Johan Dahlin <johan@src.gnome.org> | 2004-08-03 14:11:46 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2004-08-03 14:11:46 +0000 |
commit | 354412b9f37fc8d59bd539d72d3294acf68436ce (patch) | |
tree | fe128f01b4dd511aa7643788d31317828c287465 /gtk/gtkcontainer.override | |
parent | 111891a45e1bd9513d197710e0d99d78b177be9d (diff) | |
download | pygtk-354412b9f37fc8d59bd539d72d3294acf68436ce.tar.gz |
Clean up most functions here to have only one return path.
* gtk/pygtktreemodel.c: Clean up most functions here to have only
one return path.
* gobject/pygobject.c (pygobject_emit): Protect g_value_unset by
UNBLOCK/BLOCK_THREADS since it might call pygobject_free which
will result in a deadlock.
* gobject/gobjectmodule.c (pyg_thread_init): New function, move
thread initalization stuff in here.
* All over the place: Kill pyg_block/unblock_threads and use
PyGILState and Py_BEGIN/END_ALLOW_THREADS.
unblock [code] block calls are replaced by Py_BEGIN/END and
block [code] unblock calls are replaced by PyGILState.
Diffstat (limited to 'gtk/gtkcontainer.override')
-rw-r--r-- | gtk/gtkcontainer.override | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gtk/gtkcontainer.override b/gtk/gtkcontainer.override index 0efd4251..4dadb6b3 100644 --- a/gtk/gtkcontainer.override +++ b/gtk/gtkcontainer.override @@ -488,12 +488,13 @@ static void pygtk_container_for_common_marshal(GtkWidget *widget, gpointer data) { + PyGILState_STATE state; PyGtkCustomNotify *cunote = data; PyObject *py_widget, *retobj; g_assert(cunote->func); - pyg_block_threads(); + state = PyGILState_Ensure(); py_widget = pygobject_new((GObject*)widget); if (cunote->data) @@ -509,7 +510,7 @@ pygtk_container_for_common_marshal(GtkWidget *widget, Py_XDECREF(retobj); - pyg_unblock_threads(); + PyGILState_Release(state); } static PyObject * pygtk_container_for_common(PyGObject *self, PyObject *args, unsigned for_index) |