summaryrefslogtreecommitdiffstats
path: root/gobject/gobjectmodule.c
diff options
context:
space:
mode:
authorManish Singh <yosh@gimp.org>2005-08-01 22:50:42 +0000
committerManish Singh <yosh@src.gnome.org>2005-08-01 22:50:42 +0000
commit9ef8e1721cbf74cd758380ace340ca9f2f19928b (patch)
treeb39ae020119bea8b57860cd79ce9d8f4fdf23da8 /gobject/gobjectmodule.c
parentca9f9bd7c784486b1f712445d0659ea3ba19099c (diff)
downloadpygobject-9ef8e1721cbf74cd758380ace340ca9f2f19928b.tar.gz
pygobject-9ef8e1721cbf74cd758380ace340ca9f2f19928b.tar.xz
pygobject-9ef8e1721cbf74cd758380ace340ca9f2f19928b.zip
gobject/pygobject-private.h Add a convenience function
2005-08-01 Manish Singh <yosh@gimp.org> * gobject/pygobject-private.h * gobject/pygmaincontext.c: Add a convenience function (pyg_main_context_new) to create a PyGMainContext from a GMainContext. Takes care of refing the supplied GMainContext as well. * gobject/gobjectmodule.c (pyg_main_context_default) * gobject/pygmainloop.c (_wrap_g_main_loop_get_context) * gobject/pygsource.c (pyg_source_get_context): use the new convenience function here. This fixes bug #312259.
Diffstat (limited to 'gobject/gobjectmodule.c')
-rw-r--r--gobject/gobjectmodule.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 0aa7dbd..3eff89c 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -1892,18 +1892,9 @@ pyg_source_remove(PyObject *self, PyObject *args)
}
static PyObject *
-pyg_main_context_default (PyObject *unused)
+pyg_main_context_default(PyObject *unused)
{
- PyGMainContext *self;
-
- self = (PyGMainContext *)PyObject_NEW(PyGMainContext,
- &PyGMainContext_Type);
- if (self == NULL)
- return NULL;
-
- self->context = g_main_context_default();
- return (PyObject *)self;
-
+ return pyg_main_context_new(g_main_context_default());
}
static int pyg_thread_state_tls_key = -1;