static void
_gst_memory_free (GstMemory * mem)
{
+ GstAllocator *allocator;
+
GST_CAT_DEBUG (GST_CAT_MEMORY, "free memory %p", mem);
if (mem->parent) {
gst_memory_unref (mem->parent);
}
- g_object_unref (mem->allocator);
- gst_allocator_free (mem->allocator, mem);
+ allocator = mem->allocator;
+
+ gst_allocator_free (allocator, mem);
+ gst_object_unref (allocator);
}
/**
(GstMiniObjectCopyFunction) _gst_memory_copy, NULL,
(GstMiniObjectFreeFunction) _gst_memory_free);
- mem->allocator = g_object_ref (allocator);
+ mem->allocator = gst_object_ref (allocator);
if (parent) {
gst_memory_lock (parent, GST_LOCK_FLAG_EXCLUSIVE);
gst_memory_ref (parent);