From 85690b802d0aa1778105b5986aa92b39cb7c2f83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sat, 22 Dec 2012 18:43:37 +0100 Subject: [PATCH] d3dvideosink: Remove scary "while (object.refcount > 0) release (object);" code If there is a memory leak, this isn't the way how it should be fixed. --- sys/d3dvideosink/d3dhelpers.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sys/d3dvideosink/d3dhelpers.c b/sys/d3dvideosink/d3dhelpers.c index 2a9fc271d7..7f053a6718 100644 --- a/sys/d3dvideosink/d3dhelpers.c +++ b/sys/d3dvideosink/d3dhelpers.c @@ -924,16 +924,12 @@ d3d_release_swap_chain (GstD3DVideoSink * sink) if (sink->d3d.surface) { ref_count = IDirect3DSurface9_Release (sink->d3d.surface); - if (ref_count > 0) - while (IDirect3DSurface9_Release (sink->d3d.surface) > 0); sink->d3d.surface = NULL; GST_DEBUG_OBJECT (sink, "D3D surface released. Ref count: %d", ref_count); } if (sink->d3d.swapchain) { ref_count = IDirect3DSwapChain9_Release (sink->d3d.swapchain); - if (ref_count > 0) - while (IDirect3DSwapChain9_Release (sink->d3d.swapchain) > 0); sink->d3d.swapchain = NULL; GST_DEBUG_OBJECT (sink, "D3D swapchain released. Ref count: %d", ref_count); } @@ -1019,8 +1015,6 @@ d3d_resize_swap_chain (GstD3DVideoSink * sink) /* Release current swapchain */ if (sink->d3d.swapchain != NULL) { ref_count = IDirect3DSwapChain9_Release (sink->d3d.swapchain); - if (ref_count > 0) - while (IDirect3DSwapChain9_Release (sink->d3d.swapchain) > 0); if (ref_count > 0) { GST_WARNING_OBJECT (sink, "Release swapchain refcount: %d", ref_count); }