summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
index ecfa03b49..20ce51da7 100644
--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
+++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
@@ -469,6 +469,11 @@ gst_gl_window_wayland_egl_close (GstGLWindow * gl_window)
destroy_surfaces (window_egl);
+ /* As we are about to destroy the wl_source, we need to ensure everything
+ * has been sent synchronously, otherwise we will be leaking surfaces on
+ * server, leaving the window visible and unrefreshed on screen. */
+ wl_display_flush (GST_GL_DISPLAY_WAYLAND (gl_window->display)->display);
+
g_source_destroy (window_egl->wl_source);
g_source_unref (window_egl->wl_source);
window_egl->wl_source = NULL;