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

@ -1,3 +1,13 @@
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.
2006-04-09 Michael Natterer <mitch@gimp.org>
* app/plug-in/plug-in-params.[ch]: removed function

View File

@ -432,7 +432,7 @@ plug_in_handle_proc_run (PlugIn *plug_in,
g_value_array_free (args);
g_value_array_free (return_vals);
plug_in_params_destroy (proc_return.params, proc_return.nparams, FALSE);
g_free (proc_return.params);
}
static void

View File

@ -117,7 +117,7 @@ plug_in_run (Gimp *gimp,
! gimp_wire_flush (plug_in->my_write, plug_in))
{
g_free (config.display_name);
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
return_vals =
gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE);
@ -126,7 +126,7 @@ plug_in_run (Gimp *gimp,
}
g_free (config.display_name);
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_ref (plug_in);
@ -214,7 +214,7 @@ plug_in_run_temp (Gimp *gimp,
if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
! gimp_wire_flush (plug_in->my_write, plug_in))
{
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_proc_frame_pop (plug_in);
return_vals =
@ -223,7 +223,7 @@ plug_in_run_temp (Gimp *gimp,
goto done;
}
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_ref (plug_in);
plug_in_proc_frame_ref (proc_frame);

View File

@ -117,7 +117,7 @@ plug_in_run (Gimp *gimp,
! gimp_wire_flush (plug_in->my_write, plug_in))
{
g_free (config.display_name);
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
return_vals =
gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE);
@ -126,7 +126,7 @@ plug_in_run (Gimp *gimp,
}
g_free (config.display_name);
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_ref (plug_in);
@ -214,7 +214,7 @@ plug_in_run_temp (Gimp *gimp,
if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
! gimp_wire_flush (plug_in->my_write, plug_in))
{
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_proc_frame_pop (plug_in);
return_vals =
@ -223,7 +223,7 @@ plug_in_run_temp (Gimp *gimp,
goto done;
}
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_ref (plug_in);
plug_in_proc_frame_ref (proc_frame);

View File

@ -432,7 +432,7 @@ plug_in_handle_proc_run (PlugIn *plug_in,
g_value_array_free (args);
g_value_array_free (return_vals);
plug_in_params_destroy (proc_return.params, proc_return.nparams, FALSE);
g_free (proc_return.params);
}
static void

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);
}

View File

@ -29,9 +29,5 @@ GValueArray * plug_in_params_to_args (GParamSpec **pspecs,
GPParam * plug_in_args_to_params (GValueArray *args,
gboolean full_copy);
void plug_in_params_destroy (GPParam *params,
gint n_params,
gboolean full_destroy);
#endif /* __PLUG_IN_PARAMS_H__ */

View File

@ -117,7 +117,7 @@ plug_in_run (Gimp *gimp,
! gimp_wire_flush (plug_in->my_write, plug_in))
{
g_free (config.display_name);
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
return_vals =
gimp_procedure_get_return_values (GIMP_PROCEDURE (procedure), FALSE);
@ -126,7 +126,7 @@ plug_in_run (Gimp *gimp,
}
g_free (config.display_name);
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_ref (plug_in);
@ -214,7 +214,7 @@ plug_in_run_temp (Gimp *gimp,
if (! gp_temp_proc_run_write (plug_in->my_write, &proc_run, plug_in) ||
! gimp_wire_flush (plug_in->my_write, plug_in))
{
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_proc_frame_pop (plug_in);
return_vals =
@ -223,7 +223,7 @@ plug_in_run_temp (Gimp *gimp,
goto done;
}
plug_in_params_destroy (proc_run.params, proc_run.nparams, FALSE);
g_free (proc_run.params);
plug_in_ref (plug_in);
plug_in_proc_frame_ref (proc_frame);