app/widgets/gimpcontrollers.c app/widgets/gimpdevices.c

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

	* app/widgets/gimpcontrollers.c
	* app/widgets/gimpdevices.c
	* app/widgets/gimpdevicestatus.c
	* app/widgets/gimpeditor.c: allocate structs using GSlice.

svn path=/trunk/; revision=22575
This commit is contained in:
Sven Neumann 2007-05-22 16:18:32 +00:00 committed by Sven Neumann
parent 9b5679547c
commit b3d3f4f291
5 changed files with 26 additions and 14 deletions

View File

@ -1,3 +1,10 @@
2007-05-22 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcontrollers.c
* app/widgets/gimpdevices.c
* app/widgets/gimpdevicestatus.c
* app/widgets/gimpeditor.c: allocate structs using GSlice.
2007-05-22 Sven Neumann <sven@gimp.org>
* app/widgets/gimpmenufactory.c

View File

@ -86,7 +86,7 @@ gimp_controllers_init (Gimp *gimp)
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (gimp_controller_manager_get (gimp) == NULL);
manager = g_new0 (GimpControllerManager, 1);
manager = g_slice_new0 (GimpControllerManager);
g_object_set_data_full (G_OBJECT (gimp),
GIMP_CONTROLLER_MANAGER_DATA_KEY, manager,
@ -287,7 +287,7 @@ gimp_controller_manager_free (GimpControllerManager *manager)
g_object_unref (manager->controllers);
g_object_unref (manager->ui_manager);
g_free (manager);
g_slice_free (GimpControllerManager, manager);
}
static void

View File

@ -93,7 +93,7 @@ gimp_devices_init (Gimp *gimp,
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (gimp_device_manager_get (gimp) == NULL);
manager = g_new0 (GimpDeviceManager, 1);
manager = g_slice_new0 (GimpDeviceManager);
g_object_set_data_full (G_OBJECT (gimp),
GIMP_DEVICE_MANAGER_DATA_KEY, manager,
@ -409,7 +409,7 @@ gimp_device_manager_free (GimpDeviceManager *manager)
if (manager->device_info_list)
g_object_unref (manager->device_info_list);
g_free (manager);
g_slice_free (GimpDeviceManager, manager);
}
static void

View File

@ -209,7 +209,8 @@ gimp_device_status_destroy (GtkObject *object)
g_signal_handlers_disconnect_by_func (entry->device_info,
gimp_device_status_update_entry,
entry);
g_free (entry);
g_slice_free (GimpDeviceStatusEntry, entry);
}
g_list_free (status->devices);
@ -234,7 +235,7 @@ gimp_device_status_device_add (GimpContainer *devices,
if (! device_info->device)
return;
entry = g_new0 (GimpDeviceStatusEntry, 1);
entry = g_slice_new0 (GimpDeviceStatusEntry);
status->devices = g_list_prepend (status->devices, entry);
@ -385,7 +386,8 @@ gimp_device_status_device_remove (GimpContainer *devices,
g_signal_handlers_disconnect_by_func (entry->device_info,
gimp_device_status_update_entry,
entry);
g_free (entry);
g_slice_free (GimpDeviceStatusEntry, entry);
return;
}

View File

@ -540,19 +540,22 @@ gimp_editor_add_stock_box (GimpEditor *editor,
return first_button;
}
typedef struct _ExtendedAction ExtendedAction;
struct _ExtendedAction
typedef struct
{
GdkModifierType mod_mask;
GtkAction *action;
};
} ExtendedAction;
static void
gimp_editor_button_extended_actions_free (GList *list)
gimp_editor_button_extended_actions_free (GList *actions)
{
g_list_foreach (list, (GFunc) g_free, NULL);
g_list_free (list);
GList *list;
for (list = actions; list; list = list->next)
g_slice_free (ExtendedAction, list->data);
g_list_free (actions);
}
static void
@ -654,7 +657,7 @@ gimp_editor_add_action_button (GimpEditor *editor,
if (action && mod_mask)
{
ExtendedAction *ext = g_new0 (ExtendedAction, 1);
ExtendedAction *ext = g_slice_new (ExtendedAction);
ext->mod_mask = mod_mask;
ext->action = action;