From 6de5eab1e4a6d3265b42790a672b0eb36f949957 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 16 Mar 2024 22:37:46 +0900 Subject: [PATCH] d3d12: Suppress expected leak reports Such leaks are expected and intended ones Part-of: --- .../sys/d3d12/gstd3d12commandallocatorpool.cpp | 2 ++ .../gst-plugins-bad/sys/d3d12/gstd3d12commandlistpool.cpp | 2 ++ subprojects/gst-plugins-bad/sys/d3d12/gstd3d12device.cpp | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12commandallocatorpool.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12commandallocatorpool.cpp index e58b16fe69..3c0e1e4947 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12commandallocatorpool.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12commandallocatorpool.cpp @@ -207,6 +207,8 @@ gst_d3d12_command_allocator_pool_acquire (GstD3D12CommandAllocatorPool * pool, } new_cmd = gst_d3d12_command_allocator_new (ca.Get (), priv->cmd_type); + if (GST_OBJECT_FLAG_IS_SET (pool, GST_OBJECT_FLAG_MAY_BE_LEAKED)) + GST_MINI_OBJECT_FLAG_SET (new_cmd, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); } new_cmd->pool = (GstD3D12CommandAllocatorPool *) gst_object_ref (pool); diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12commandlistpool.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12commandlistpool.cpp index c3aaec00bf..398c8d1588 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12commandlistpool.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12commandlistpool.cpp @@ -210,6 +210,8 @@ gst_d3d12_command_list_pool_acquire (GstD3D12CommandListPool * pool, } new_cmd = gst_d3d12_command_list_new (cl.Get (), priv->cmd_type); + if (GST_OBJECT_FLAG_IS_SET (pool, GST_OBJECT_FLAG_MAY_BE_LEAKED)) + GST_MINI_OBJECT_FLAG_SET (new_cmd, GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED); } else { new_cmd->cl->QueryInterface (IID_PPV_ARGS (&cl)); hr = cl->Reset (ca, nullptr); diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12device.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12device.cpp index 1a820ffecb..386aa5b842 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12device.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12device.cpp @@ -738,6 +738,14 @@ gst_d3d12_device_new_internal (const GstD3D12DeviceConstructData * data) priv->rtv_inc_size = device->GetDescriptorHandleIncrementSize (D3D12_DESCRIPTOR_HEAP_TYPE_RTV); + GST_OBJECT_FLAG_SET (priv->direct_queue, GST_OBJECT_FLAG_MAY_BE_LEAKED); + GST_OBJECT_FLAG_SET (priv->direct_cl_pool, GST_OBJECT_FLAG_MAY_BE_LEAKED); + GST_OBJECT_FLAG_SET (priv->direct_ca_pool, GST_OBJECT_FLAG_MAY_BE_LEAKED); + + GST_OBJECT_FLAG_SET (priv->copy_queue, GST_OBJECT_FLAG_MAY_BE_LEAKED); + GST_OBJECT_FLAG_SET (priv->copy_cl_pool, GST_OBJECT_FLAG_MAY_BE_LEAKED); + GST_OBJECT_FLAG_SET (priv->copy_ca_pool, GST_OBJECT_FLAG_MAY_BE_LEAKED); + return self; error: