[vlc-devel] [PATCH] decoder_helpers: release the resources the decoder device may have created
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jun 7 15:49:15 CEST 2019
Otherwise it leaks or asserts.
---
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);
}
}
--
2.17.1
More information about the vlc-devel
mailing list