[vlc-devel] commit: playlist: Don't allow pl_Release(p_playlist) and pl_Yield( p_playlist). (Pierre d'Herbemont )

git version control git at videolan.org
Sat Aug 2 05:22:29 CEST 2008


vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat Aug  2 05:25:06 2008 +0200| [fa81ade13492bab2a809e6c8990e211f04aecab8] | committer: Pierre d'Herbemont 

playlist: Don't allow pl_Release(p_playlist) and pl_Yield(p_playlist).

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

 src/playlist/control.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/playlist/control.c b/src/playlist/control.c
index 2cb00e9..89ac8fb 100644
--- a/src/playlist/control.c
+++ b/src/playlist/control.c
@@ -47,6 +47,10 @@ playlist_t *__pl_Yield( vlc_object_t *p_this )
 
     barrier ();
     pl = libvlc_priv (p_this->p_libvlc)->p_playlist;
+
+    assert( pl != p_this /* This does not make sense to yield the playlist
+    using pl_Yield. use vlc_object_yield in this case */ );
+
     if (pl)
         vlc_object_yield (pl);
     return pl;
@@ -56,6 +60,10 @@ void __pl_Release( vlc_object_t *p_this )
 {
     playlist_t *pl = libvlc_priv (p_this->p_libvlc)->p_playlist;
     assert( pl != NULL );
+    
+    assert( pl != p_this /* The rule is that pl_Release() should act on
+    the same object than pl_Yield() */ );
+
     vlc_object_release( pl );
 }
 




More information about the vlc-devel mailing list