diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-07-09 14:45:25 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-07-09 14:45:25 +0000 |
commit | 3a70f2630f8514c841bb5ddeff9f0fad91a99605 (patch) | |
tree | 6d17c78803429405d3a44c02bd220f4c5202a2e2 | |
parent | 5f8d2d3431dfd55a85567e9240d284aef526da8c (diff) | |
download | pygobject-3a70f2630f8514c841bb5ddeff9f0fad91a99605.tar.gz pygobject-3a70f2630f8514c841bb5ddeff9f0fad91a99605.tar.xz pygobject-3a70f2630f8514c841bb5ddeff9f0fad91a99605.zip |
interface implementation fix
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | gobject/gobjectmodule.c | 20 |
2 files changed, 13 insertions, 10 deletions
@@ -5,6 +5,9 @@ type. This should fix interface implementation (actually I thought such code had already been added earlier but can't find it now and it is obviously needed...) + (pyg_type_register): move the code that needs g_type_class_ref + until after interface registration (more code that I already wrote + in the past but got lost). 2006-07-05 John Finlay <finlay@moeraki.com> diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 774edf9..d4909a9 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -1312,16 +1312,6 @@ pyg_type_register(PyTypeObject *class, const char *type_name) PyErr_Clear(); } - gclass = g_type_class_ref(instance_type); - if (pyg_run_class_init(instance_type, gclass, class)) { - g_type_class_unref(gclass); - return -1; - } - g_type_class_unref(gclass); - - if (gsignals) - PyDict_DelItemString(class->tp_dict, "__gsignals__"); - /* Register interface implementations */ if (class->tp_bases) { for (i = 0; i < PyTuple_GET_SIZE(class->tp_bases); ++i) @@ -1353,6 +1343,16 @@ pyg_type_register(PyTypeObject *class, const char *type_name) } else g_warning("type has no tp_bases"); + gclass = g_type_class_ref(instance_type); + if (pyg_run_class_init(instance_type, gclass, class)) { + g_type_class_unref(gclass); + return -1; + } + g_type_class_unref(gclass); + + if (gsignals) + PyDict_DelItemString(class->tp_dict, "__gsignals__"); + return 0; } |