Index: gobjectmodule.c =================================================================== RCS file: /cvs/gnome/gnome-python/pygtk/gobject/gobjectmodule.c,v retrieving revision 1.189 diff -u -p -r1.189 gobjectmodule.c --- gobjectmodule.c 31 Jul 2005 15:16:39 -0000 1.189 +++ gobjectmodule.c 1 Aug 2005 16:59:07 -0000 @@ -1901,7 +1901,7 @@ pyg_main_context_default (PyObject *unus if (self == NULL) return NULL; - self->context = g_main_context_default(); + self->context = g_main_context_ref(g_main_context_default()); return (PyObject *)self; } Index: pygmainloop.c =================================================================== RCS file: /cvs/gnome/gnome-python/pygtk/gobject/pygmainloop.c,v retrieving revision 1.6 diff -u -p -r1.6 pygmainloop.c --- pygmainloop.c 10 Feb 2005 16:16:39 -0000 1.6 +++ pygmainloop.c 1 Aug 2005 16:59:07 -0000 @@ -238,6 +238,8 @@ _wrap_g_main_loop_get_context (PyGMainLo if (self->context == NULL) return NULL; + g_main_context_ref(self->context); + return (PyObject *)self; }