mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 03:29:50 +00:00
[703/906] x11: don't segfault if destroy_cb is NULL
This commit is contained in:
parent
5818b015d6
commit
9e7af77dc8
2 changed files with 6 additions and 3 deletions
|
@ -73,7 +73,7 @@ _gl_mem_init (GstGLMemory * mem, GstAllocator * allocator, GstMemory * parent,
|
||||||
gst_memory_init (GST_MEMORY_CAST (mem), GST_MEMORY_FLAG_NO_SHARE,
|
gst_memory_init (GST_MEMORY_CAST (mem), GST_MEMORY_FLAG_NO_SHARE,
|
||||||
allocator, parent, maxsize, 0, 0, maxsize);
|
allocator, parent, maxsize, 0, 0, maxsize);
|
||||||
|
|
||||||
mem->display = g_object_ref (display);
|
mem->display = gst_object_ref (display);
|
||||||
mem->gl_format = GL_RGBA;
|
mem->gl_format = GL_RGBA;
|
||||||
mem->v_format = v_format;
|
mem->v_format = v_format;
|
||||||
mem->width = width;
|
mem->width = width;
|
||||||
|
@ -338,7 +338,9 @@ _gl_mem_free (GstAllocator * allocator, GstMemory * mem)
|
||||||
if (gl_mem->tex_id)
|
if (gl_mem->tex_id)
|
||||||
gst_gl_display_del_texture (gl_mem->display, &gl_mem->tex_id);
|
gst_gl_display_del_texture (gl_mem->display, &gl_mem->tex_id);
|
||||||
|
|
||||||
g_object_unref (gl_mem->display);
|
gst_object_unref (gl_mem->upload);
|
||||||
|
gst_object_unref (gl_mem->download);
|
||||||
|
gst_object_unref (gl_mem->display);
|
||||||
|
|
||||||
if (gl_mem->notify)
|
if (gl_mem->notify)
|
||||||
gl_mem->notify (gl_mem->user_data);
|
gl_mem->notify (gl_mem->user_data);
|
||||||
|
|
|
@ -696,7 +696,8 @@ gst_gl_window_x11_run (GstGLWindow * window)
|
||||||
if (!destroy_cb || !destroy_data)
|
if (!destroy_cb || !destroy_data)
|
||||||
GST_FIXME ("destroy cb not correctly set");
|
GST_FIXME ("destroy cb not correctly set");
|
||||||
|
|
||||||
destroy_cb (destroy_data);
|
if (destroy_cb)
|
||||||
|
destroy_cb (destroy_data);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
GST_DEBUG ("client message not recognized");
|
GST_DEBUG ("client message not recognized");
|
||||||
|
|
Loading…
Reference in a new issue