summaryrefslogtreecommitdiffstats
path: root/gobject/pygobject.c
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2004-08-02 11:03:05 +0000
committerJohan Dahlin <johan@src.gnome.org>2004-08-02 11:03:05 +0000
commit3e41db376f6e40c2df01a1f83c2ecf10a5315084 (patch)
treea4146d2ca0d7516cbcd334048286a710e2692a58 /gobject/pygobject.c
parentfa82703297dadadf71b26650a8bafd55fc101dce (diff)
downloadpygobject-3e41db376f6e40c2df01a1f83c2ecf10a5315084.tar.gz
pygobject-3e41db376f6e40c2df01a1f83c2ecf10a5315084.tar.xz
pygobject-3e41db376f6e40c2df01a1f83c2ecf10a5315084.zip
Call PyEval_InitThreads. Perhaps its something that always should bePYGTK_2_3_95
* gobject/gobjectmodule.c (initgobject): Call PyEval_InitThreads. Perhaps its something that always should be called. * README (Author): Add a requirements section * configure.in: Require Python 2.3 * setup.py (version): Ditto * gobject/pygtype.c, gobject/pygobject.h: Remove 2.2 compat. * All over the place: Add support for PyGILState.
Diffstat (limited to 'gobject/pygobject.c')
-rw-r--r--gobject/pygobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gobject/pygobject.c b/gobject/pygobject.c
index 8b33744..d29d1d7 100644
--- a/gobject/pygobject.c
+++ b/gobject/pygobject.c
@@ -181,6 +181,7 @@ pygobject_register_wrapper(PyObject *self)
PyTypeObject *
pygobject_new_with_interfaces(GType gtype)
{
+ PyGILState_STATE state;
PyObject *o;
PyTypeObject *type;
PyObject *dict;
@@ -246,10 +247,14 @@ pygobject_new_with_interfaces(GType gtype)
type_name = g_strconcat(mod_name, ".", gtype_name, NULL);
}
+ state = PyGILState_Ensure();
+
type = (PyTypeObject*)PyObject_CallFunction((PyObject*)&PyType_Type, "sOO",
type_name, bases, dict);
g_free(type_name);
+ PyGILState_Release(state);
+
if (type == NULL) {
PyErr_Print();
return NULL;