diff options
author | Johan Dahlin <johan@src.gnome.org> | 2006-07-25 15:51:15 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2006-07-25 15:51:15 +0000 |
commit | e3bba3b12b7612193bcae379140c3793f0d671b6 (patch) | |
tree | 4cb63d4b42eba09790e37e12d9358917bee8623b /gobject/pygenum.c | |
parent | 0fa4afadb8f462d48d29321359ea87f53d400c90 (diff) | |
download | pygobject-e3bba3b12b7612193bcae379140c3793f0d671b6.tar.gz |
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.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gobject/pygenum.c b/gobject/pygenum.c index 2c0ee127..d1bb20f5 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); } } |