From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Robin Ebert <ebertrobin2002@gmail.com>
Date: Wed, 25 Jan 2023 17:31:46 +0100
Subject: [PATCH] Destroy all created wayland object in terminateDisplay

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

diff --git a/src/wayland-egldisplay.c b/src/wayland-egldisplay.c
index aaf0ff653217..284d2add762c 100644
--- a/src/wayland-egldisplay.c
+++ b/src/wayland-egldisplay.c
@@ -412,6 +412,14 @@ static EGLBoolean terminateDisplay(WlEglDisplay *display, EGLBoolean globalTeard
             wl_eglstream_display_destroy(display->wlStreamDpy);
             display->wlStreamDpy = NULL;
         }
+        if (display->wlStreamCtl) {
+            wl_eglstream_controller_destroy(display->wlStreamCtl);
+            display->wlStreamCtl = NULL;
+        }
+        if (display->wlDmaBuf) {
+            zwp_linux_dmabuf_v1_destroy(display->wlDmaBuf);
+            display->wlDmaBuf = NULL;
+        }
         if (display->wlEventQueue) {
             wl_event_queue_destroy(display->wlEventQueue);
             display->wlEventQueue = NULL;
