From: Andoni Morales Alastruey Date: Fri, 8 Jul 2022 18:38:51 +0000 (+0200) Subject: gl: Fix leak of the whole CGL context X-Git-Tag: 1.22.0~1284 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7db2a3cf11c8d1aa5e3d3e9ef730c6014a5902a1;p=platform%2Fupstream%2Fgstreamer.git 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: --- 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 3adb0cd..6b618d2 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