[vlc-devel] [PATCH] p_vlm-destruction-fixes

Sébastien Escudier sebastien-devel at celeos.eu
Fri Jun 5 16:26:20 CEST 2009


Quoting Rémi Denis-Courmont <remi at remlab.net>:

> Le mercredi 27 mai 2009 12:50:22 Sébastien Escudier, vous avez écrit :
> > Hi
> >
> > This patch fixes two bugs :
> >
> > - Using option --vlm-conf AND libvlc_vlm_* function was leaking vlm
> > - Calling libvlc_vlm_release and then libvlc_vlm_* was crashing.
>
> I don't understand how this fixes the problem. Now, libvlc_vlm_release() will

I didn't change the way libvlc_vlm_release is working. It is still calling
vlm_Delete( p_vlm ); I just nullified the pointer.

> release VLM, regardless of the vlm-conf option... In case of --vlm-conf, I
> think libvlccore is responsible for releasing the reference (so that it works
> with plain VLC), not libvlc_vlm_release()...

libvlc_vlm_release still release VLM only if VLM was not loaded by vlm-conf.
libvlccore is still responsible for this, it is done in core.c
libvlc_InternalCleanup call.

> I guess I am missing something.

There are two separates fixes in the patch :
1- Using option --vlm-conf AND libvlc_vlm_* function was leaking vlm

fixed by :
+++ b/src/control/core.c
@@ -173,6 +173,8 @@ void libvlc_release( libvlc_instance_t *p_instance )
     {
         vlc_mutex_destroy( lock );
         vlc_mutex_destroy( &p_instance->event_callback_lock );
+        if( p_instance->p_vlm )
+            vlm_Delete( p_instance->p_vlm );



2- Calling libvlc_vlm_release and then libvlc_vlm_* was crashing.
fixed by
+++ b/src/control/vlm.c
@@ -167,6 +167,7 @@ void libvlc_vlm_release( libvlc_instance_t *p_instance,
     VLM(p_vlm);

     vlm_Delete( p_vlm );
+    p_instance->p_vlm = NULL;




More information about the vlc-devel mailing list