summaryrefslogtreecommitdiff
path: root/gi/pyginterface.c
diff options
context:
space:
mode:
Diffstat (limited to 'gi/pyginterface.c')
-rw-r--r--gi/pyginterface.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gi/pyginterface.c b/gi/pyginterface.c
index 34db8fac..288fbb25 100644
--- a/gi/pyginterface.c
+++ b/gi/pyginterface.c
@@ -85,15 +85,21 @@ pyg_register_interface(PyObject *dict, const gchar *class_name,
}
g_type_set_qdata(gtype, pyginterface_type_key, type);
-
+
PyDict_SetItemString(dict, (char *)class_name, (PyObject *)type);
-
+
}
void
pyg_register_interface_info(GType gtype, const GInterfaceInfo *info)
{
- g_type_set_qdata(gtype, pyginterface_info_key, (gpointer) info);
+ GInterfaceInfo *prev_info = pyg_lookup_interface_info (gtype);
+
+ if (prev_info) {
+ g_free (prev_info);
+ }
+
+ g_type_set_qdata(gtype, pyginterface_info_key, g_memdup2 (info, sizeof(GInterfaceInfo)));
}
const GInterfaceInfo *