[vlc-commits] decoder_helpers: release the resources the decoder device may have created

Steve Lhomme git at videolan.org
Tue Jun 11 16:31:36 CEST 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jun  7 15:47:45 2019 +0200| [6376b2e8bd9a1a85d6909b3abbdfc578597433c4] | committer: Steve Lhomme

decoder_helpers: release the resources the decoder device may have created

Otherwise it leaks or asserts.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6376b2e8bd9a1a85d6909b3abbdfc578597433c4
---

 src/input/decoder_helpers.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index 3d1c574cb7..1c4593db30 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -31,6 +31,7 @@
 #include <vlc_atomic.h>
 #include <vlc_meta.h>
 #include <vlc_modules.h>
+#include "libvlc.h"
 
 void decoder_Init( decoder_t *p_dec, const es_format_t *restrict p_fmt )
 {
@@ -138,6 +139,7 @@ vlc_decoder_device_Create(vout_window_t *window)
     free(name);
     if (!priv->module)
     {
+        vlc_objres_clear(VLC_OBJECT(&priv->device));
         vlc_object_delete(&priv->device);
         return NULL;
     }
@@ -162,6 +164,7 @@ vlc_decoder_device_Release(vlc_decoder_device *device)
     if (vlc_atomic_rc_dec(&priv->rc))
     {
         vlc_module_unload(priv->module, decoder_device_Close, device);
+        vlc_objres_clear(VLC_OBJECT(device));
         vlc_object_delete(device);
     }
 }



More information about the vlc-commits mailing list