[703/906] x11: don't segfault if destroy_cb is NULL
This commit is contained in:
parent
5818b015d6
commit
9e7af77dc8
@ -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,6 +696,7 @@ 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");
|
||||||
|
|
||||||
|
if (destroy_cb)
|
||||||
destroy_cb (destroy_data);
|
destroy_cb (destroy_data);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user