]> git.sesse.net Git - vlc/commitdiff
ML/Core: Destroy ML after PL deactivates, but before it destroys
authorSrikanth Raju <srikiraju@gmail.com>
Mon, 24 Jan 2011 16:02:57 +0000 (21:32 +0530)
committerSrikanth Raju <srikiraju@gmail.com>
Mon, 24 Jan 2011 16:34:03 +0000 (22:04 +0530)
src/libvlc.c

index 718f7a75d2a1e286b1b44b2be7e90ffe4f1fa576..270701da5eacc08e45e4bd4f4b2d078b6d9c7402 100644 (file)
@@ -973,16 +973,6 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     libvlc_priv_t *priv = libvlc_priv (p_libvlc);
     playlist_t    *p_playlist = libvlc_priv (p_libvlc)->p_playlist;
 
-#if defined(MEDIA_LIBRARY)
-    media_library_t* p_ml = priv->p_ml;
-    if( p_ml )
-    {
-        ml_Destroy( VLC_OBJECT( p_ml ) );
-        vlc_object_release( p_ml );
-        libvlc_priv(p_playlist->p_libvlc)->p_ml = NULL;
-    }
-#endif
-
     /* Deactivate the playlist */
     msg_Dbg( p_libvlc, "deactivating the playlist" );
     pl_Deactivate( p_libvlc );
@@ -1004,6 +994,16 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     }
 #endif
 
+#if defined(MEDIA_LIBRARY)
+    media_library_t* p_ml = priv->p_ml;
+    if( p_ml )
+    {
+        ml_Destroy( VLC_OBJECT( p_ml ) );
+        vlc_object_release( p_ml );
+        libvlc_priv(p_playlist->p_libvlc)->p_ml = NULL;
+    }
+#endif
+
     /* Free playlist now, all threads are gone */
     playlist_Destroy( p_playlist );
     stats_TimersDumpAll( p_libvlc );