summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--gobject/gobjectmodule.c5
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d6ac0f2..04bf867 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-07-09 Gustavo J. A. M. Carneiro <gjc@gnome.org>
+
+ * gobject/gobjectmodule.c (pyg_type_register): Make interface_data
+ point to the python type before adding the interface to the new
+ 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...)
+
2006-07-05 John Finlay <finlay@moeraki.com>
* gobject/pygiochannel.c (py_io_channel_init): Fix message typo.
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c
index 00630ae..774edf9 100644
--- a/gobject/gobjectmodule.c
+++ b/gobject/gobjectmodule.c
@@ -1330,12 +1330,15 @@ pyg_type_register(PyTypeObject *class, const char *type_name)
(PyTypeObject *) PyTuple_GET_ITEM(class->tp_bases, i);
GType itype;
const GInterfaceInfo *iinfo;
+ GInterfaceInfo iinfo_copy;
if (((PyTypeObject *) base)->tp_base != &PyGInterface_Type)
continue;
itype = pyg_type_from_object((PyObject *) base);
iinfo = pyg_lookup_interface_info(itype);
+ iinfo_copy = *iinfo;
+ iinfo_copy.interface_data = class;
if (!iinfo) {
char *msg;
msg = g_strdup_printf("Interface type %s "
@@ -1345,7 +1348,7 @@ pyg_type_register(PyTypeObject *class, const char *type_name)
g_free(msg);
continue;
}
- g_type_add_interface_static(instance_type, itype, iinfo);
+ g_type_add_interface_static(instance_type, itype, &iinfo_copy);
}
} else
g_warning("type has no tp_bases");