Zebediah Figura : strmbase: Factor out strmbase_sink_cleanup().

Alexandre Julliard julliard at winehq.org
Thu Jun 13 15:40:38 CDT 2019


Module: wine
Branch: master
Commit: cec43c1822f82063c1a4464153b46951431b674e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=cec43c1822f82063c1a4464153b46951431b674e

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Wed Jun 12 18:58:36 2019 -0500

strmbase: Factor out strmbase_sink_cleanup().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/strmbase/pin.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/dlls/strmbase/pin.c b/dlls/strmbase/pin.c
index 6bc9927..688a5bc 100644
--- a/dlls/strmbase/pin.c
+++ b/dlls/strmbase/pin.c
@@ -1150,13 +1150,18 @@ HRESULT BaseInputPin_Construct(const IPinVtbl *InputPin_Vtbl, LONG inputpin_size
     return S_OK;
 }
 
+static void strmbase_sink_cleanup(BaseInputPin *pin)
+{
+    FreeMediaType(&pin->pin.mtCurrent);
+    if (pin->pAllocator)
+        IMemAllocator_Release(pin->pAllocator);
+    pin->pAllocator = NULL;
+    pin->pin.IPin_iface.lpVtbl = NULL;
+}
+
 HRESULT WINAPI BaseInputPin_Destroy(BaseInputPin *This)
 {
-    FreeMediaType(&This->pin.mtCurrent);
-    if (This->pAllocator)
-        IMemAllocator_Release(This->pAllocator);
-    This->pAllocator = NULL;
-    This->pin.IPin_iface.lpVtbl = NULL;
+    strmbase_sink_cleanup(This);
     CoTaskMemFree(This);
     return S_OK;
 }




More information about the wine-cvs mailing list