[vlc-commits] commit: ML/Core: Release ML before playlist deactivates (Srikanth Raju )

git at videolan.org git at videolan.org
Sat Jan 15 21:22:54 CET 2011


vlc | branch: master | Srikanth Raju <srikiraju at gmail.com> | Sun Jan 16 01:45:31 2011 +0530| [0ff3d0e674e84dedc3965d65fae706f562fbb469] | committer: Srikanth Raju 

ML/Core: Release ML before playlist deactivates

ML holds some PL resources

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

 src/libvlc.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 9f9b71d..718f7a7 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -973,6 +973,16 @@ 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 );
@@ -996,17 +1006,6 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
 
     /* Free playlist now, all threads are gone */
     playlist_Destroy( 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
-
     stats_TimersDumpAll( p_libvlc );
     stats_TimersCleanAll( p_libvlc );
 



More information about the vlc-commits mailing list