summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo J. A. M. Carneiro <gjc@src.gnome.org>2006-07-09 14:22:51 +0000
committerGustavo J. A. M. Carneiro <gjc@src.gnome.org>2006-07-09 14:22:51 +0000
commit5f8d2d3431dfd55a85567e9240d284aef526da8c (patch)
treeec074fcd93edd86da49b9ece2119b683b3e131dd
parent9c6df9cf3f30d6da6418a051eec221b836277c97 (diff)
downloadpygobject-5f8d2d3431dfd55a85567e9240d284aef526da8c.tar.gz
pygobject-5f8d2d3431dfd55a85567e9240d284aef526da8c.tar.xz
pygobject-5f8d2d3431dfd55a85567e9240d284aef526da8c.zip
missing iinfo.interface_data, needed for interface implementation
-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");