From f7fc9fd76ecad058c4463f6ebed31e286fc96fdd Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Thu, 2 Feb 2023 23:20:04 +1100 Subject: [PATCH] gl/cocoa: Return a strong ref to the parent GstGLContext If the GstGLCAOpenGLLayer was initialized via a parent context, make sure to ref the context before returning it from getGLContext as all callers will unref it. Follow up to !3729 Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcaopengllayer.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcaopengllayer.m b/subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcaopengllayer.m index 1498a54..e4ce6eb 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcaopengllayer.m +++ b/subprojects/gst-plugins-base/gst-libs/gst/gl/cocoa/gstglcaopengllayer.m @@ -65,7 +65,7 @@ _init_debug (void) GstGLWindow *gst_gl_window; GstGLContext *gst_gl_context = NULL; if (gst_gl_context_ref) - return gst_gl_context_ref; + return gst_object_ref(gst_gl_context_ref); gst_gl_window = g_weak_ref_get (&self->gst_gl_window_ref); if (gst_gl_window) { gst_gl_context = gst_gl_window_get_context (gst_gl_window); -- 2.7.4