summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--gobject/pygenum.c10
-rw-r--r--gobject/pygflags.c12
3 files changed, 19 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 45093586..7f12dc16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-07-25 Johan Dahlin <jdahlin@async.com.br>
+
+ * gobject/pygflags.c (pyg_flags_add)
+ * gobject/pygenum.c (pyg_enum_add): Duplicate the string before
+ sending it to python. Fixes GCC warnings.
+
2006-07-24 John Finlay <finlay@moeraki.com>
* gobject/pygflags.c (pyg_flags_get_first_value_name)
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);
}
}
diff --git a/gobject/pygflags.c b/gobject/pygflags.c
index f53cb49b..442e3325 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);
}
}