From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: q234rty <q23456yuiop@gmail.com>
Date: Fri, 7 Apr 2023 18:08:03 +0800
Subject: [PATCH] Fix wrong destruction order for event queue

---
 src/wayland-egldisplay.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c
index 284d2add762c..99e6e3b82953 100644
--- a/src/wayland-egldisplay.c
+++ b/src/wayland-egldisplay.c
@@ -481,12 +481,12 @@ static void getServerProtocolsInfo(struct wl_display *nativeDpy,
         }
     }
 
+    if (wlRegistry) {
+        wl_registry_destroy(wlRegistry);
+    }
     if (queue) {
         wl_event_queue_destroy(queue);
     }
-    if (wlRegistry) {
-       wl_registry_destroy(wlRegistry);
-    }
 }
 
 EGLDisplay wlEglGetPlatformDisplayExport(void *data,
