dshow: cleanup internal references on capture interface
authorRamiro Polla <ramiro.polla@gmail.com>
Fri, 9 Sep 2011 03:16:06 +0000 (00:16 -0300)
committerStefano Sabatini <stefasab@gmail.com>
Fri, 16 Sep 2011 09:16:05 +0000 (11:16 +0200)
Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
libavdevice/dshow_enumpins.c
libavdevice/dshow_filter.c

index 97890fb..02e967a 100644 (file)
@@ -94,6 +94,12 @@ libAVEnumPins_Setup(libAVEnumPins *this, libAVPin *pin, libAVFilter *filter)
 
     return 1;
 }
+static int
+libAVEnumPins_Cleanup(libAVEnumPins *this)
+{
+    libAVFilter_Release(this->filter);
+    return 1;
+}
 DECLARE_CREATE(libAVEnumPins, libAVEnumPins_Setup(this, pin, filter),
                libAVPin *pin, libAVFilter *filter)
-DECLARE_DESTROY(libAVEnumPins, nothing)
+DECLARE_DESTROY(libAVEnumPins, libAVEnumPins_Cleanup)
index e5a3be8..64e8306 100644 (file)
@@ -191,6 +191,12 @@ libAVFilter_Setup(libAVFilter *this, void *priv_data, void *callback,
 
     return 1;
 }
+static int
+libAVFilter_Cleanup(libAVFilter *this)
+{
+    libAVPin_Release(this->pin);
+    return 1;
+}
 DECLARE_CREATE(libAVFilter, libAVFilter_Setup(this, priv_data, callback, type),
                void *priv_data, void *callback, enum dshowDeviceType type)
-DECLARE_DESTROY(libAVFilter, nothing)
+DECLARE_DESTROY(libAVFilter, libAVFilter_Cleanup)