removed this function. We only have shallow GPParam arrays in the core

2006-04-09  Michael Natterer  <mitch@gimp.org>

	* app/plug-in/plug-in-params.[ch] (plug_in_params_destroy):
	removed this function. We only have shallow GPParam arrays in the
	core that can be freed with g_free(), and gp_params_destroy()
	could always be used for freeing deep copies.

	* app/plug-in/plug-in-message.c
	* app/plug-in/plug-in-run.c: simply g_free() the GPParam arrays.
This commit is contained in:
Michael Natterer
2006-04-09 17:19:58 +00:00
committed by Michael Natterer
parent 73a9abd337
commit d411d1c0dd
8 changed files with 24 additions and 105 deletions

View File

@ -406,90 +406,3 @@ plug_in_args_to_params (GValueArray *args,
return params;
}
void
plug_in_params_destroy (GPParam *params,
gint n_params,
gboolean full_destroy)
{
gint i, j;
if (full_destroy)
{
for (i = 0; i < n_params; i++)
{
switch (params[i].type)
{
case GIMP_PDB_INT32:
case GIMP_PDB_INT16:
case GIMP_PDB_INT8:
case GIMP_PDB_FLOAT:
break;
case GIMP_PDB_STRING:
g_free (params[i].data.d_string);
break;
case GIMP_PDB_INT32ARRAY:
g_free (params[i].data.d_int32array);
break;
case GIMP_PDB_INT16ARRAY:
g_free (params[i].data.d_int16array);
break;
case GIMP_PDB_INT8ARRAY:
g_free (params[i].data.d_int8array);
break;
case GIMP_PDB_FLOATARRAY:
g_free (params[i].data.d_floatarray);
break;
case GIMP_PDB_STRINGARRAY:
for (j = 0; j < params[i-1].data.d_int32; j++)
g_free (params[i].data.d_stringarray[j]);
g_free (params[i].data.d_stringarray);
break;
case GIMP_PDB_COLOR:
break;
case GIMP_PDB_REGION:
g_message ("the \"region\" argument type is not supported");
break;
case GIMP_PDB_DISPLAY:
case GIMP_PDB_IMAGE:
case GIMP_PDB_LAYER:
case GIMP_PDB_CHANNEL:
case GIMP_PDB_DRAWABLE:
case GIMP_PDB_SELECTION:
break;
case GIMP_PDB_BOUNDARY:
g_message ("the \"boundary\" arg type is not currently supported");
break;
case GIMP_PDB_VECTORS:
break;
case GIMP_PDB_PARASITE:
if (params[i].data.d_parasite.data)
{
g_free (params[i].data.d_parasite.name);
g_free (params[i].data.d_parasite.data);
params[i].data.d_parasite.name = NULL;
params[i].data.d_parasite.data = NULL;
}
break;
case GIMP_PDB_STATUS:
case GIMP_PDB_END:
break;
}
}
}
g_free (params);
}