gdk/*: Use g_list_free_full convenience function

This commit is contained in:
Javier Jardón
2012-01-03 02:18:50 +01:00
parent 08a2b910e5
commit 24360a8076
8 changed files with 13 additions and 26 deletions

View File

@ -1213,8 +1213,7 @@ gdk_broadway_display_finalize (GObject *object)
_gdk_broadway_cursor_display_finalize (GDK_DISPLAY_OBJECT(broadway_display)); _gdk_broadway_cursor_display_finalize (GDK_DISPLAY_OBJECT(broadway_display));
/* input GdkDevice list */ /* input GdkDevice list */
g_list_foreach (broadway_display->input_devices, (GFunc) g_object_unref, NULL); g_list_free_full (broadway_display->input_devices, g_object_unref);
g_list_free (broadway_display->input_devices);
/* Free all GdkScreens */ /* Free all GdkScreens */
g_object_unref (broadway_display->screens[0]); g_object_unref (broadway_display->screens[0]);
g_free (broadway_display->screens); g_free (broadway_display->screens);

View File

@ -154,8 +154,7 @@ free_device_grabs_foreach (gpointer key,
{ {
GList *list = value; GList *list = value;
g_list_foreach (list, (GFunc) free_device_grab, NULL); g_list_free_full (list, (GDestroyNotify) free_device_grab);
g_list_free (list);
return TRUE; return TRUE;
} }
@ -211,8 +210,7 @@ gdk_display_dispose (GObject *object)
device_manager = gdk_display_get_device_manager (GDK_DISPLAY (object)); device_manager = gdk_display_get_device_manager (GDK_DISPLAY (object));
g_list_foreach (display->queued_events, (GFunc)gdk_event_free, NULL); g_list_free_full (display->queued_events, (GDestroyNotify) gdk_event_free);
g_list_free (display->queued_events);
display->queued_events = NULL; display->queued_events = NULL;
display->queued_tail = NULL; display->queued_tail = NULL;

View File

@ -2065,12 +2065,8 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
window->clip_region_with_children = NULL; window->clip_region_with_children = NULL;
} }
if (window->outstanding_moves) g_list_free_full (window->outstanding_moves, (GDestroyNotify) gdk_window_region_move_free);
{ window->outstanding_moves = NULL;
g_list_foreach (window->outstanding_moves, (GFunc)gdk_window_region_move_free, NULL);
g_list_free (window->outstanding_moves);
window->outstanding_moves = NULL;
}
} }
break; break;
} }
@ -3945,8 +3941,7 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
} }
} }
g_list_foreach (children, (GFunc)g_object_unref, NULL); g_list_free_full (children, g_object_unref);
g_list_free (children);
} }

View File

@ -308,8 +308,7 @@ gdk_quartz_display_finalize (GObject *object)
{ {
GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object); GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object);
g_list_foreach (display_quartz->input_devices, (GFunc) g_object_unref, NULL); g_list_free_full (display_quartz->input_devices, g_object_unref);
g_list_free (display_quartz->input_devices);
G_OBJECT_CLASS (gdk_quartz_display_parent_class)->finalize (object); G_OBJECT_CLASS (gdk_quartz_display_parent_class)->finalize (object);
} }

View File

@ -823,8 +823,7 @@ gdk_device_manager_core_finalize (GObject *object)
device_manager_core = GDK_DEVICE_MANAGER_CORE (object); device_manager_core = GDK_DEVICE_MANAGER_CORE (object);
g_list_foreach (device_manager_core->devices, free_device, NULL); g_list_free_full (device_manager_core->devices, free_device);
g_list_free (device_manager_core->devices);
G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object); G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object);
} }

View File

@ -274,8 +274,7 @@ gdk_wayland_display_finalize (GObject *object)
g_object_unref (display_wayland->keymap); g_object_unref (display_wayland->keymap);
/* input GdkDevice list */ /* input GdkDevice list */
g_list_foreach (display_wayland->input_devices, (GFunc) g_object_unref, NULL); g_list_free_full (display_wayland->input_devices, g_object_unref);
g_list_free (display_wayland->input_devices);
g_object_unref (display_wayland->screen); g_object_unref (display_wayland->screen);

View File

@ -308,8 +308,8 @@ gdk_x11_device_manager_xi_dispose (GObject *object)
GdkX11DeviceManagerXI *device_manager; GdkX11DeviceManagerXI *device_manager;
device_manager = GDK_X11_DEVICE_MANAGER_XI (object); device_manager = GDK_X11_DEVICE_MANAGER_XI (object);
g_list_foreach (device_manager->devices, (GFunc) g_object_unref, NULL);
g_list_free (device_manager->devices); g_list_free_full (device_manager->devices, g_object_unref);
device_manager->devices = NULL; device_manager->devices = NULL;
if (device_manager->id_table != NULL) if (device_manager->id_table != NULL)

View File

@ -1767,12 +1767,10 @@ gdk_x11_display_finalize (GObject *object)
g_slist_free (display_x11->event_types); g_slist_free (display_x11->event_types);
/* input GdkDevice list */ /* input GdkDevice list */
g_list_foreach (display_x11->input_devices, (GFunc) g_object_unref, NULL); g_list_free_full (display_x11->input_devices, g_object_unref);
g_list_free (display_x11->input_devices);
/* input GdkWindow list */ /* input GdkWindow list */
g_list_foreach (display_x11->input_windows, (GFunc) g_free, NULL); g_list_free_full (display_x11->input_windows, g_free);
g_list_free (display_x11->input_windows);
/* Free all GdkScreens */ /* Free all GdkScreens */
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++) for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)