Commit 24360a80 authored by Javier Jardón's avatar Javier Jardón

gdk/*: Use g_list_free_full convenience function

parent 08a2b910
......@@ -1213,8 +1213,7 @@ gdk_broadway_display_finalize (GObject *object)
_gdk_broadway_cursor_display_finalize (GDK_DISPLAY_OBJECT(broadway_display));
/* input GdkDevice list */
g_list_foreach (broadway_display->input_devices, (GFunc) g_object_unref, NULL);
g_list_free (broadway_display->input_devices);
g_list_free_full (broadway_display->input_devices, g_object_unref);
/* Free all GdkScreens */
g_object_unref (broadway_display->screens[0]);
g_free (broadway_display->screens);
......
......@@ -154,8 +154,7 @@ free_device_grabs_foreach (gpointer key,
{
GList *list = value;
g_list_foreach (list, (GFunc) free_device_grab, NULL);
g_list_free (list);
g_list_free_full (list, (GDestroyNotify) free_device_grab);
return TRUE;
}
......@@ -211,8 +210,7 @@ gdk_display_dispose (GObject *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 (display->queued_events);
g_list_free_full (display->queued_events, (GDestroyNotify) gdk_event_free);
display->queued_events = NULL;
display->queued_tail = NULL;
......
......@@ -2065,12 +2065,8 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
window->clip_region_with_children = NULL;
}
if (window->outstanding_moves)
{
g_list_foreach (window->outstanding_moves, (GFunc)gdk_window_region_move_free, NULL);
g_list_free (window->outstanding_moves);
window->outstanding_moves = NULL;
}
g_list_free_full (window->outstanding_moves, (GDestroyNotify) gdk_window_region_move_free);
window->outstanding_moves = NULL;
}
break;
}
......@@ -3945,8 +3941,7 @@ _gdk_window_process_updates_recurse (GdkWindow *window,
}
}
g_list_foreach (children, (GFunc)g_object_unref, NULL);
g_list_free (children);
g_list_free_full (children, g_object_unref);
}
......
......@@ -308,8 +308,7 @@ gdk_quartz_display_finalize (GObject *object)
{
GdkQuartzDisplay *display_quartz = GDK_QUARTZ_DISPLAY (object);
g_list_foreach (display_quartz->input_devices, (GFunc) g_object_unref, NULL);
g_list_free (display_quartz->input_devices);
g_list_free_full (display_quartz->input_devices, g_object_unref);
G_OBJECT_CLASS (gdk_quartz_display_parent_class)->finalize (object);
}
......
......@@ -823,8 +823,7 @@ gdk_device_manager_core_finalize (GObject *object)
device_manager_core = GDK_DEVICE_MANAGER_CORE (object);
g_list_foreach (device_manager_core->devices, free_device, NULL);
g_list_free (device_manager_core->devices);
g_list_free_full (device_manager_core->devices, free_device);
G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object);
}
......
......@@ -274,8 +274,7 @@ gdk_wayland_display_finalize (GObject *object)
g_object_unref (display_wayland->keymap);
/* input GdkDevice list */
g_list_foreach (display_wayland->input_devices, (GFunc) g_object_unref, NULL);
g_list_free (display_wayland->input_devices);
g_list_free_full (display_wayland->input_devices, g_object_unref);
g_object_unref (display_wayland->screen);
......
......@@ -308,8 +308,8 @@ gdk_x11_device_manager_xi_dispose (GObject *object)
GdkX11DeviceManagerXI *device_manager;
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;
if (device_manager->id_table != NULL)
......
......@@ -1767,12 +1767,10 @@ gdk_x11_display_finalize (GObject *object)
g_slist_free (display_x11->event_types);
/* input GdkDevice list */
g_list_foreach (display_x11->input_devices, (GFunc) g_object_unref, NULL);
g_list_free (display_x11->input_devices);
g_list_free_full (display_x11->input_devices, g_object_unref);
/* input GdkWindow list */
g_list_foreach (display_x11->input_windows, (GFunc) g_free, NULL);
g_list_free (display_x11->input_windows);
g_list_free_full (display_x11->input_windows, g_free);
/* Free all GdkScreens */
for (i = 0; i < ScreenCount (display_x11->xdisplay); i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment