From 7db2a3cf11c8d1aa5e3d3e9ef730c6014a5902a1 Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Fri, 8 Jul 2022 20:38:51 +0200 Subject: [PATCH] gl: Fix leak of the whole CGL context This was leaking the CGL context and several resources allocated in the context, around 70MB for a 1080p clip Part-of: --- .../gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m b/subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m index 3adb0cd6be..6b618d2fd9 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m @@ -352,7 +352,12 @@ gst_gl_context_cocoa_swap_buffers (GstGLContext * context) static void gst_gl_context_cocoa_destroy_context (GstGLContext *context) { - /* FIXME: Need to release context and other things? */ + GstGLContextCocoa *context_cocoa = GST_GL_CONTEXT_COCOA (context); + + if (context_cocoa->priv->gl_context != NULL) { + CGLDestroyContext(context_cocoa->priv->gl_context); + context_cocoa->priv->gl_context = NULL; + } } static guintptr