gst-plugins-base: gl: wayland: cleanup on close
authorRouven Czerwinski <r.czerwinski@pengutronix.de>
Thu, 6 Apr 2023 05:58:03 +0000 (07:58 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 6 Apr 2023 11:16:58 +0000 (12:16 +0100)
The proxy and queue are created in the gst_gl_window_wayland_egl_open()
function and will be recreated on open. This leaks both objects, the
wayland client documentation mentions that they should be destroyed
using the appropriate destroy functions.

Found during valgrind memory leak testing, these blocks were marked as
definitely lost.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4355>

subprojects/gst-plugins-base/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c

index f2d7ceb..440b635 100644 (file)
@@ -478,6 +478,9 @@ gst_gl_window_wayland_egl_close (GstGLWindow * gl_window)
   g_source_unref (window_egl->wl_source);
   window_egl->wl_source = NULL;
 
+  wl_proxy_wrapper_destroy (window_egl->display.display);
+  wl_event_queue_destroy (window_egl->window.queue);
+
   GST_GL_WINDOW_CLASS (parent_class)->close (gl_window);
 }