plug-ins/script-fu/script-fu-scripts.c use GSlice to allocate structs.

2007-05-22  Sven Neumann  <sven@gimp.org>

	* plug-ins/script-fu/script-fu-scripts.c
	* plug-ins/script-fu/script-fu-interface.c: use GSlice to allocate
	structs.

svn path=/trunk/; revision=22568
This commit is contained in:
Sven Neumann
2007-05-22 14:20:08 +00:00
committed by Sven Neumann
parent ba25863e49
commit 017ff2e06d
3 changed files with 14 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2007-05-22 Sven Neumann <sven@gimp.org>
* plug-ins/script-fu/script-fu-scripts.c
* plug-ins/script-fu/script-fu-interface.c: use GSlice to allocate
structs.
2007-05-22 Sven Neumann <sven@gimp.org>
* libgimp/gimpdrawable.c

View File

@ -209,7 +209,8 @@ script_fu_interface (SFScript *script,
gtk_initted = TRUE;
}
sf_interface = g_new0 (SFInterface, 1);
sf_interface = g_slice_new0 (SFInterface);
sf_interface->widgets = g_new0 (GtkWidget *, script->num_args);
/* strip mnemonics from the menupath */
@ -631,7 +632,7 @@ script_fu_interface_quit (SFScript *script)
g_free (sf_interface->widgets);
g_free (sf_interface->last_command);
g_free (sf_interface);
g_slice_free (SFInterface, sf_interface);
sf_interface = NULL;
/*

View File

@ -157,7 +157,7 @@ script_fu_add_script (scheme *sc, pointer a)
}
/* Create a new script */
script = g_new0 (SFScript, 1);
script = g_slice_new0 (SFScript);
/* Find the script name */
val = sc->vptr->string_value (sc->vptr->pair_car (a));
@ -646,7 +646,7 @@ script_fu_add_menu (scheme *sc, pointer a)
}
/* Create a new list of menus */
menu = g_new0 (SFMenu, 1);
menu = g_slice_new0 (SFMenu);
menu->script = script;
@ -740,7 +740,7 @@ script_fu_install_menu (SFMenu *menu)
gimp_plugin_menu_register (menu->script->name, menu->menu_path);
g_free (menu->menu_path);
g_free (menu);
g_slice_free (SFMenu, menu);
}
/*
@ -754,11 +754,7 @@ script_fu_remove_script (gpointer foo G_GNUC_UNUSED,
GList *list;
for (list = scripts; list; list = g_list_next (list))
{
SFScript *script = list->data;
script_fu_free_script (script);
}
script_fu_free_script (list->data);
g_list_free (scripts);
@ -1149,7 +1145,7 @@ script_fu_free_script (SFScript *script)
g_free (script->arg_types);
g_free (script->arg_values);
g_free (script);
g_slice_free (SFScript, script);
}
static gint