[gimp] libgimp, plug-ins: use g_strfreev() to free PDB string arrays
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimp, plug-ins: use g_strfreev() to free PDB string arrays
- Date: Tue, 27 Nov 2012 20:17:29 +0000 (UTC)
commit c77fc779dbdf648cf92782377023da0dbeb8de5f
Author: Michael Natterer <mitch gimp org>
Date: Tue Nov 27 21:16:26 2012 +0100
libgimp, plug-ins: use g_strfreev() to free PDB string arrays
libgimp/gimpprocbrowserdialog.c | 4 +---
plug-ins/common/file-dicom.c | 12 +++---------
plug-ins/gradient-flare/gradient-flare.c | 2 ++
plug-ins/pygimp/gimpmodule.c | 9 +++------
plug-ins/pygimp/pygimp-drawable.c | 3 +--
plug-ins/pygimp/pygimp-image.c | 3 +--
plug-ins/pygimp/pygimp-pdb.c | 5 ++---
plug-ins/pygimp/pygimp-vectors.c | 3 +--
plug-ins/script-fu/scheme-wrapper.c | 4 +---
9 files changed, 15 insertions(+), 30 deletions(-)
---
diff --git a/libgimp/gimpprocbrowserdialog.c b/libgimp/gimpprocbrowserdialog.c
index a7b5ca0..9e561c9 100644
--- a/libgimp/gimpprocbrowserdialog.c
+++ b/libgimp/gimpprocbrowserdialog.c
@@ -521,11 +521,9 @@ browser_search (GimpBrowser *browser,
gtk_list_store_set (dialog->store, &iter,
COLUMN_PROC_NAME, proc_list[i],
-1);
-
- g_free (proc_list[i]);
}
- g_free (proc_list);
+ g_strfreev (proc_list);
gtk_tree_view_columns_autosize (GTK_TREE_VIEW (dialog->tree_view));
diff --git a/plug-ins/common/file-dicom.c b/plug-ins/common/file-dicom.c
index 0a2a5ee..de11b9c 100644
--- a/plug-ins/common/file-dicom.c
+++ b/plug-ins/common/file-dicom.c
@@ -1127,18 +1127,12 @@ dicom_get_elements_list (gint32 image_ID)
gimp_parasite_free (parasite);
}
}
-
- /* make sure we free each individual parasite name, in
- * addition to the array of names
- */
- g_free (parasites[i]);
}
}
+
/* cleanup the array of names */
- if (parasites)
- {
- g_free (parasites);
- }
+ g_strfreev (parasites);
+
return elements;
}
diff --git a/plug-ins/gradient-flare/gradient-flare.c b/plug-ins/gradient-flare/gradient-flare.c
index f30cfcd..f97c4b6 100644
--- a/plug-ins/gradient-flare/gradient-flare.c
+++ b/plug-ins/gradient-flare/gradient-flare.c
@@ -4726,6 +4726,8 @@ gradient_get_list (gint *num_gradients)
gradients[n++] = g_strdup (external_gradients[i]);
}
+ g_strfreev (external_gradients);
+
return gradients;
}
diff --git a/plug-ins/pygimp/gimpmodule.c b/plug-ins/pygimp/gimpmodule.c
index 7ad8383..28367f2 100644
--- a/plug-ins/pygimp/gimpmodule.c
+++ b/plug-ins/pygimp/gimpmodule.c
@@ -910,10 +910,9 @@ pygimp_gradients_get_list(PyObject *self, PyObject *args, PyObject *kwargs)
for (i = 0; i < num; i++) {
PyList_SetItem(ret, i, PyString_FromString(list[i]));
- g_free(list[i]);
}
- g_free(list);
+ g_strfreev(list);
return ret;
}
@@ -1319,10 +1318,9 @@ pygimp_parasite_list(PyObject *self)
for (i = 0; i < num_parasites; i++) {
PyTuple_SetItem(ret, i, PyString_FromString(parasites[i]));
- g_free(parasites[i]);
}
- g_free(parasites);
+ g_strfreev(parasites);
return ret;
}
@@ -1473,10 +1471,9 @@ pygimp_fonts_get_list(PyObject *self, PyObject *args, PyObject *kwargs)
for (i = 0; i < num; i++) {
PyList_SetItem(ret, i, PyString_FromString(list[i]));
- g_free(list[i]);
}
- g_free(list);
+ g_strfreev(list);
return ret;
}
diff --git a/plug-ins/pygimp/pygimp-drawable.c b/plug-ins/pygimp/pygimp-drawable.c
index 91f25a0..a4b0b25 100644
--- a/plug-ins/pygimp/pygimp-drawable.c
+++ b/plug-ins/pygimp/pygimp-drawable.c
@@ -317,10 +317,9 @@ drw_parasite_list(PyGimpDrawable *self)
for (i = 0; i < num_parasites; i++) {
PyTuple_SetItem(ret, i, PyString_FromString(parasites[i]));
- g_free(parasites[i]);
}
- g_free(parasites);
+ g_strfreev(parasites);
return ret;
}
diff --git a/plug-ins/pygimp/pygimp-image.c b/plug-ins/pygimp/pygimp-image.c
index 7c1926c..36389b2 100644
--- a/plug-ins/pygimp/pygimp-image.c
+++ b/plug-ins/pygimp/pygimp-image.c
@@ -736,10 +736,9 @@ img_parasite_list(PyGimpImage *self)
for (i = 0; i < num_parasites; i++) {
PyTuple_SetItem(ret, i, PyString_FromString(parasites[i]));
- g_free(parasites[i]);
}
- g_free(parasites);
+ g_strfreev(parasites);
return ret;
}
diff --git a/plug-ins/pygimp/pygimp-pdb.c b/plug-ins/pygimp/pygimp-pdb.c
index cdf5299..ead3934 100644
--- a/plug-ins/pygimp/pygimp-pdb.c
+++ b/plug-ins/pygimp/pygimp-pdb.c
@@ -637,7 +637,7 @@ pdb_query(PyGimpPDB *self, PyObject *args)
for (i = 0; i < num; i++)
PyList_SetItem(ret, i, PyString_FromString(names[i]));
- g_free(names);
+ g_strfreev(names);
return ret;
}
@@ -723,10 +723,9 @@ build_procedure_list(void)
*p = '_';
}
PyList_SetItem(ret, i, PyString_FromString(name));
- g_free(name);
}
- g_free(names);
+ g_strfreev(names);
return ret;
}
diff --git a/plug-ins/pygimp/pygimp-vectors.c b/plug-ins/pygimp/pygimp-vectors.c
index fa83ab6..d4ea9de 100644
--- a/plug-ins/pygimp/pygimp-vectors.c
+++ b/plug-ins/pygimp/pygimp-vectors.c
@@ -707,10 +707,9 @@ vectors_parasite_list(PyGimpVectors *self)
for (i = 0; i < num_parasites; i++) {
PyTuple_SetItem(ret, i, PyString_FromString(parasites[i]));
- g_free(parasites[i]);
}
- g_free(parasites);
+ g_strfreev(parasites);
return ret;
}
diff --git a/plug-ins/script-fu/scheme-wrapper.c b/plug-ins/script-fu/scheme-wrapper.c
index e7e00d3..83b5c41 100644
--- a/plug-ins/script-fu/scheme-wrapper.c
+++ b/plug-ins/script-fu/scheme-wrapper.c
@@ -566,11 +566,9 @@ ts_init_procedures (scheme *sc,
gimp_destroy_paramdefs (params, n_params);
gimp_destroy_paramdefs (return_vals, n_return_vals);
}
-
- g_free (proc_list[i]);
}
- g_free (proc_list);
+ g_strfreev (proc_list);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]