summaryrefslogtreecommitdiffstats
path: root/gobject/pygflags.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/pygflags.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/pygflags.c')
-rw-r--r--gobject/pygflags.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/gobject/pygflags.c b/gobject/pygflags.c
index f53cb49..442e332 100644
--- a/gobject/pygflags.c
+++ b/gobject/pygflags.c
@@ -251,11 +251,13 @@ pyg_flags_add (PyObject * module,
Py_DECREF(intval);
if (module) {
- PyModule_AddObject(module,
- pyg_constant_strip_prefix(eclass->values[i].value_name,
- strip_prefix),
- item);
- Py_INCREF(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);
}
}