[PATCH 3/6] strmbase: Factor out strmbase_source_cleanup().

Zebediah Figura z.figura12 at gmail.com
Thu Jun 13 18:09:20 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/strmbase/pin.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index eb0f4693f67..f1b24c3dad7 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -773,12 +773,17 @@ HRESULT WINAPI BaseOutputPin_Construct(const IPinVtbl *OutputPin_Vtbl, LONG outp
     return S_OK;
 }
 
+static void strmbase_source_cleanup(BaseOutputPin *pin)
+{
+    FreeMediaType(&pin->pin.mtCurrent);
+    if (pin->pAllocator)
+        IMemAllocator_Release(pin->pAllocator);
+    pin->pAllocator = NULL;
+}
+
 HRESULT WINAPI BaseOutputPin_Destroy(BaseOutputPin *This)
 {
-    FreeMediaType(&This->pin.mtCurrent);
-    if (This->pAllocator)
-        IMemAllocator_Release(This->pAllocator);
-    This->pAllocator = NULL;
+    strmbase_source_cleanup(This);
     CoTaskMemFree(This);
     return S_OK;
 }
-- 
2.20.1




More information about the wine-devel mailing list