From e317b9be00fbca01a75ab9597c4eab92c565379d Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 2 Dec 2020 16:51:31 -0800 Subject: [PATCH] macos: maintain GList element consistency We need to keep this consistent so that we can look things up faster in other places. Therefore, just take the hit here and clear the entire list ensuring prev/next poniters are cleared. --- gdk/macos/gdkmacosdisplay.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdk/macos/gdkmacosdisplay.c b/gdk/macos/gdkmacosdisplay.c index 9772059bcf..37532fd079 100644 --- a/gdk/macos/gdkmacosdisplay.c +++ b/gdk/macos/gdkmacosdisplay.c @@ -1056,9 +1056,8 @@ _gdk_macos_display_clear_sorting (GdkMacosDisplay *self) { g_return_if_fail (GDK_IS_MACOS_DISPLAY (self)); - self->sorted_surfaces.head = NULL; - self->sorted_surfaces.tail = NULL; - self->sorted_surfaces.length = 0; + while (self->sorted_surfaces.head != NULL) + g_queue_unlink (&self->sorted_surfaces, self->sorted_surfaces.head); } const GList *