mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 15:08:48 +00:00
glcaopengllayer: NULL some fields when freed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6566>
This commit is contained in:
parent
592f85fd6c
commit
17b0b949a4
1 changed files with 4 additions and 6 deletions
|
@ -51,9 +51,9 @@ _init_debug (void)
|
|||
- (void)dealloc {
|
||||
if (self->draw_notify)
|
||||
self->draw_notify (self->draw_data);
|
||||
self->draw_notify = NULL;
|
||||
|
||||
if (self->draw_context)
|
||||
gst_object_unref (self->draw_context);
|
||||
gst_clear_object (&self->draw_context);
|
||||
|
||||
g_weak_ref_clear (&self->gst_gl_window_ref);
|
||||
self->gst_gl_context_ref = NULL;
|
||||
|
@ -125,7 +125,7 @@ _context_ready (gpointer data)
|
|||
|
||||
if (gst_gl_context) {
|
||||
fmt = gst_gl_context_cocoa_get_pixel_format (GST_GL_CONTEXT_COCOA (gst_gl_context));
|
||||
gst_object_unref (gst_gl_context);
|
||||
gst_clear_object (&gst_gl_context);
|
||||
}
|
||||
|
||||
if (!fmt) {
|
||||
|
@ -159,7 +159,6 @@ _context_ready (gpointer data)
|
|||
|
||||
if (!gst_gl_context) {
|
||||
GST_ERROR ("failed to retrieve GStreamer GL context in CAOpenGLLayer");
|
||||
gst_clear_object (&gst_gl_context);
|
||||
return NULL;
|
||||
}
|
||||
external_context = (CGLContextObj) gst_gl_context_get_gl_context (gst_gl_context);
|
||||
|
@ -174,8 +173,7 @@ _context_ready (gpointer data)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (self->draw_context)
|
||||
gst_object_unref (self->draw_context);
|
||||
gst_clear_object (&self->draw_context);
|
||||
|
||||
if (kCGLNoError != CGLSetCurrentContext (self->gl_context)) {
|
||||
GST_ERROR ("failed set cgl context %p current", self->gl_context);
|
||||
|
|
Loading…
Reference in a new issue