summaryrefslogtreecommitdiffstats
path: root/gobject/pygenum.c
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2006-07-25 15:51:15 +0000
committerJohan Dahlin <johan@src.gnome.org>2006-07-25 15:51:15 +0000
commite3bba3b12b7612193bcae379140c3793f0d671b6 (patch)
tree4cb63d4b42eba09790e37e12d9358917bee8623b /gobject/pygenum.c
parent0fa4afadb8f462d48d29321359ea87f53d400c90 (diff)
downloadpygobject-e3bba3b12b7612193bcae379140c3793f0d671b6.tar.gz
pygobject-e3bba3b12b7612193bcae379140c3793f0d671b6.tar.xz
pygobject-e3bba3b12b7612193bcae379140c3793f0d671b6.zip
gobject/pygflags.c (pyg_flags_add) Duplicate the string before sending it
* gobject/pygflags.c (pyg_flags_add) * gobject/pygenum.c (pyg_enum_add): Duplicate the string before sending it to python. Fixes GCC warnings.
Diffstat (limited to 'gobject/pygenum.c')
-rw-r--r--gobject/pygenum.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gobject/pygenum.c b/gobject/pygenum.c
index 2c0ee12..d1bb20f 100644
--- a/gobject/pygenum.c
+++ b/gobject/pygenum.c
@@ -225,10 +225,12 @@ pyg_enum_add (PyObject * module,
Py_DECREF(intval);
if (module) {
- PyModule_AddObject(module,
- pyg_constant_strip_prefix(eclass->values[i].value_name,
- strip_prefix),
- item);
+ char *prefix;
+
+ prefix = g_strdup(pyg_constant_strip_prefix(eclass->values[i].value_name, strip_prefix));
+ PyModule_AddObject(module, prefix, item);
+ g_free(prefix);
+
Py_INCREF(item);
}
}