]> git.sesse.net Git - vlc/commitdiff
dereference p_libvlc->p_vlm after the media clean up
authorSébastien Escudier <sebastien-devel@celeos.eu>
Tue, 21 Feb 2012 11:56:56 +0000 (12:56 +0100)
committerSébastien Escudier <sebastien-devel@celeos.eu>
Mon, 27 Feb 2012 12:08:32 +0000 (13:08 +0100)
src/input/vlm.c

index 1e7aff7b6c66ece6694d1b0e69513d85b7c8a68d..4dce5ec2fbf10423ca963e3bcbb05778efc17fc7 100644 (file)
@@ -214,16 +214,15 @@ void vlm_Delete( vlm_t *p_vlm )
     vlc_mutex_lock( &vlm_mutex );
     assert( p_vlm->users > 0 );
     if( --p_vlm->users == 0 )
-    {
         assert( libvlc_priv(p_vlm->p_libvlc)->p_vlm == p_vlm );
-        libvlc_priv(p_vlm->p_libvlc)->p_vlm = NULL;
-    }
     else
         p_vlm = NULL;
-    vlc_mutex_unlock( &vlm_mutex );
 
     if( p_vlm == NULL )
+    {
+        vlc_mutex_unlock( &vlm_mutex );
         return;
+    }
 
     /* Destroy and release VLM */
     vlc_mutex_lock( &p_vlm->lock );
@@ -242,6 +241,9 @@ void vlm_Delete( vlm_t *p_vlm )
         vlc_object_release( p_vlm->p_vod );
     }
 
+    libvlc_priv(p_vlm->p_libvlc)->p_vlm = NULL;
+    vlc_mutex_unlock( &vlm_mutex );
+
     vlc_mutex_lock( &p_vlm->lock_manage );
     p_vlm->input_state_changed = true;
     vlc_cond_signal( &p_vlm->wait_manage );