From 4ec5642b504e2f435bae52d87c344c1c3ab82736 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 14 Dec 2005 13:19:18 +0000 Subject: [PATCH] declare gp_params_destroy() in the private header file. 2005-12-14 Sven Neumann * libgimpbase/gimpprotocol.[ch]: declare gp_params_destroy() in the private header file. * libgimp/gimp.c (gimp_destroy_params): removed extern declaration. --- ChangeLog | 7 +++++++ libgimp/gimp.c | 2 -- libgimpbase/gimpprotocol.c | 12 +++++------- libgimpbase/gimpprotocol.h | 3 +++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0559b9f0ae..eb7c7496da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-12-14 Sven Neumann + + * libgimpbase/gimpprotocol.[ch]: declare gp_params_destroy() in + the private header file. + + * libgimp/gimp.c (gimp_destroy_params): removed extern declaration. + 2005-12-13 Sven Neumann * libgimpbase/gimpwire.[ch]: let the private wire methods live in diff --git a/libgimp/gimp.c b/libgimp/gimp.c index 84a4cde716..dbd2f1dff7 100644 --- a/libgimp/gimp.c +++ b/libgimp/gimp.c @@ -986,8 +986,6 @@ void gimp_destroy_params (GimpParam *params, gint n_params) { - extern void gp_params_destroy (GPParam *params, gint n_params); - gp_params_destroy ((GPParam *) params, n_params); } diff --git a/libgimpbase/gimpprotocol.c b/libgimpbase/gimpprotocol.c index 2fcfcf604b..164f6d7614 100644 --- a/libgimpbase/gimpprotocol.c +++ b/libgimpbase/gimpprotocol.c @@ -133,10 +133,6 @@ static void _gp_params_write (GIOChannel *channel, gint nparams, gpointer user_data); -/* used by gimp.c:gimp_destroy_params() */ -void gp_params_destroy (GPParam *params, - gint nparams); - static void _gp_has_init_read (GIOChannel *channel, GimpWireMessage *msg, gpointer user_data); @@ -1746,8 +1742,7 @@ void gp_params_destroy (GPParam *params, gint nparams) { - gint count; - gint i, j; + gint i; for (i = 0; i < nparams; i++) { @@ -1793,9 +1788,12 @@ gp_params_destroy (GPParam *params, case GIMP_PDB_STRINGARRAY: if ((i > 0) && (params[i-1].type == GIMP_PDB_INT32)) { - count = params[i-1].data.d_int32; + gint count = params[i-1].data.d_int32; + gint j; + for (j = 0; j < count; j++) g_free (params[i].data.d_stringarray[j]); + g_free (params[i].data.d_stringarray); } break; diff --git a/libgimpbase/gimpprotocol.h b/libgimpbase/gimpprotocol.h index 662f64899c..240b24db1d 100644 --- a/libgimpbase/gimpprotocol.h +++ b/libgimpbase/gimpprotocol.h @@ -228,6 +228,9 @@ gboolean gp_extension_ack_write (GIOChannel *channel, gboolean gp_has_init_write (GIOChannel *channel, gpointer user_data); +void gp_params_destroy (GPParam *params, + gint nparams); + G_END_DECLS