mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-31 03:29:50 +00:00
glbasememory: Free the actual memory object when requested
Otherwise we are leaking ~400B on each GstMemory allocation. Freeing in the base class matches the GObject semantics.
This commit is contained in:
parent
3423e108d4
commit
04ec728722
2 changed files with 3 additions and 8 deletions
|
@ -442,6 +442,8 @@ _mem_free (GstAllocator * allocator, GstMemory * memory)
|
|||
mem->notify (mem->user_data);
|
||||
|
||||
gst_object_unref (mem->context);
|
||||
|
||||
g_free (memory);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -236,7 +236,7 @@ _gl_mem_new (GstAllocator * allocator, GstMemory * parent,
|
|||
GDestroyNotify notify)
|
||||
{
|
||||
GstGLMemoryPBO *mem;
|
||||
mem = g_slice_new0 (GstGLMemoryPBO);
|
||||
mem = g_new0 (GstGLMemoryPBO, 1);
|
||||
mem->mem.texture_wrapped = FALSE;
|
||||
|
||||
_gl_mem_init (mem, allocator, parent, context, target, params, info, plane,
|
||||
|
@ -657,12 +657,6 @@ _gl_mem_destroy (GstGLMemoryPBO * gl_mem)
|
|||
*) gl_mem);
|
||||
}
|
||||
|
||||
static void
|
||||
_gl_mem_free (GstAllocator * allocator, GstMemory * mem)
|
||||
{
|
||||
GST_ALLOCATOR_CLASS (parent_class)->free (allocator, mem);
|
||||
}
|
||||
|
||||
static GstGLMemoryPBO *
|
||||
_gl_mem_pbo_alloc (GstGLBaseMemoryAllocator * allocator,
|
||||
GstGLVideoAllocationParams * params)
|
||||
|
@ -722,7 +716,6 @@ gst_gl_memory_pbo_allocator_class_init (GstGLMemoryPBOAllocatorClass * klass)
|
|||
gl_base->destroy = (GstGLBaseMemoryAllocatorDestroyFunction) _gl_mem_destroy;
|
||||
|
||||
allocator_class->alloc = _gl_mem_alloc;
|
||||
allocator_class->free = _gl_mem_free;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue