From edd5911249b012e454029ca76bb15aa2539ce505 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: --- .../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 1498a545d6..e4ce6eb080 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);