mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
[703/906] x11: don't segfault if destroy_cb is NULL
This commit is contained in:
parent
6dfee9c975
commit
2d69905592
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,
|
||||
allocator, parent, maxsize, 0, 0, maxsize);
|
||||
|
||||
mem->display = g_object_ref (display);
|
||||
mem->display = gst_object_ref (display);
|
||||
mem->gl_format = GL_RGBA;
|
||||
mem->v_format = v_format;
|
||||
mem->width = width;
|
||||
|
@ -338,7 +338,9 @@ _gl_mem_free (GstAllocator * allocator, GstMemory * mem)
|
|||
if (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)
|
||||
gl_mem->notify (gl_mem->user_data);
|
||||
|
|
|
@ -696,7 +696,8 @@ gst_gl_window_x11_run (GstGLWindow * window)
|
|||
if (!destroy_cb || !destroy_data)
|
||||
GST_FIXME ("destroy cb not correctly set");
|
||||
|
||||
destroy_cb (destroy_data);
|
||||
if (destroy_cb)
|
||||
destroy_cb (destroy_data);
|
||||
|
||||
} else
|
||||
GST_DEBUG ("client message not recognized");
|
||||
|
|
Loading…
Reference in a new issue