d3d11memory: Remove GstD3D11PoolAllocator::dispose

Clear GstD3D11Device object in finalize method as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3726>
This commit is contained in:
Seungha Yang 2023-01-12 22:14:30 +09:00 committed by Tim-Philipp Müller
parent fe90b08d2f
commit 230ecf3cd9

View file

@ -1514,7 +1514,6 @@ struct _GstD3D11PoolAllocatorPrivate
gsize mem_size; gsize mem_size;
}; };
static void gst_d3d11_pool_allocator_dispose (GObject * object);
static void gst_d3d11_pool_allocator_finalize (GObject * object); static void gst_d3d11_pool_allocator_finalize (GObject * object);
static gboolean static gboolean
@ -1535,7 +1534,6 @@ gst_d3d11_pool_allocator_class_init (GstD3D11PoolAllocatorClass * klass)
GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstD3D11AllocatorClass *d3d11alloc_class = GST_D3D11_ALLOCATOR_CLASS (klass); GstD3D11AllocatorClass *d3d11alloc_class = GST_D3D11_ALLOCATOR_CLASS (klass);
gobject_class->dispose = gst_d3d11_pool_allocator_dispose;
gobject_class->finalize = gst_d3d11_pool_allocator_finalize; gobject_class->finalize = gst_d3d11_pool_allocator_finalize;
d3d11alloc_class->set_actvie = gst_d3d11_pool_allocator_set_active; d3d11alloc_class->set_actvie = gst_d3d11_pool_allocator_set_active;
@ -1562,16 +1560,6 @@ gst_d3d11_pool_allocator_init (GstD3D11PoolAllocator * allocator)
gst_poll_write_control (priv->poll); gst_poll_write_control (priv->poll);
} }
static void
gst_d3d11_pool_allocator_dispose (GObject * object)
{
GstD3D11PoolAllocator *self = GST_D3D11_POOL_ALLOCATOR (object);
gst_clear_object (&self->device);
G_OBJECT_CLASS (pool_alloc_parent_class)->dispose (object);
}
static void static void
gst_d3d11_pool_allocator_finalize (GObject * object) gst_d3d11_pool_allocator_finalize (GObject * object)
{ {
@ -1587,6 +1575,8 @@ gst_d3d11_pool_allocator_finalize (GObject * object)
GST_D3D11_CLEAR_COM (priv->texture); GST_D3D11_CLEAR_COM (priv->texture);
gst_clear_object (&self->device);
G_OBJECT_CLASS (pool_alloc_parent_class)->finalize (object); G_OBJECT_CLASS (pool_alloc_parent_class)->finalize (object);
} }