From 43130835845f40b2b12438e4b587e62b033c724f Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 13 Apr 2024 23:53:00 +0900 Subject: [PATCH] d3d12encoder: Fix buffer pool leak Add missing buffer pool release Part-of: --- subprojects/gst-plugins-bad/sys/d3d12/gstd3d12encoder.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12encoder.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12encoder.cpp index fdaec99512..e4e4ac8ec1 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12encoder.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12encoder.cpp @@ -69,6 +69,9 @@ struct EncoderSessionData ~EncoderSessionData () { + if (upload_pool) + gst_buffer_pool_set_active (upload_pool, FALSE); + gst_clear_object (&upload_pool); gst_clear_object (&encoder_pool); gst_queue_array_free (output_queue); } @@ -463,11 +466,13 @@ gst_d3d12_encoder_create_upload_pool (GstD3D12Encoder * self) if (!gst_buffer_pool_set_config (pool, config)) { GST_ERROR_OBJECT (self, "Set config failed"); + gst_object_unref (pool); return nullptr; } if (!gst_buffer_pool_set_active (pool, TRUE)) { GST_ERROR_OBJECT (self, "Set active failed"); + gst_object_unref (pool); return nullptr; }