d3d11memory: Remove GstD3D11PoolAllocator::dispose
authorSeungha Yang <seungha@centricular.com>
Thu, 12 Jan 2023 13:14:30 +0000 (22:14 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 12 Jan 2023 19:26:41 +0000 (19:26 +0000)
Clear GstD3D11Device object in finalize method as well

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3715>

subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11memory.cpp

index 869812b48673fc08c19707afefb3fa613d8b60f4..37f43f0c372f4c90042ee292fd572e7ca655f75a 100644 (file)
@@ -1755,7 +1755,6 @@ struct _GstD3D11PoolAllocatorPrivate
   gsize mem_size;
 };
 
-static void gst_d3d11_pool_allocator_dispose (GObject * object);
 static void gst_d3d11_pool_allocator_finalize (GObject * object);
 
 static gboolean
@@ -1776,7 +1775,6 @@ gst_d3d11_pool_allocator_class_init (GstD3D11PoolAllocatorClass * klass)
   GObjectClass *gobject_class = G_OBJECT_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;
 
   d3d11alloc_class->set_active = gst_d3d11_pool_allocator_set_active;
@@ -1804,16 +1802,6 @@ gst_d3d11_pool_allocator_init (GstD3D11PoolAllocator * allocator)
   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
 gst_d3d11_pool_allocator_finalize (GObject * object)
 {
@@ -1829,6 +1817,8 @@ gst_d3d11_pool_allocator_finalize (GObject * object)
 
   GST_D3D11_CLEAR_COM (priv->texture);
 
+  gst_clear_object (&self->device);
+
   G_OBJECT_CLASS (pool_alloc_parent_class)->finalize (object);
 }