[vlc-devel] commit: Fix sout leak if the playlist is gone ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Jun 4 17:41:28 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Jun  4 18:43:06 2008 +0300| [a8712a3720567c0b03612d0d93d354bd90f8b138]

Fix sout leak if the playlist is gone

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

 src/input/input.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 9914457..b73e1d9 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -325,10 +325,7 @@ static void Destructor( input_thread_t * p_input )
         if( priv->b_sout_keep )
             SoutKeep( priv->p_sout );
         else
-        {
             sout_DeleteInstance( priv->p_sout );
-            priv->p_sout = NULL;
-        }
     }
 #endif
     vlc_gc_decref( p_input->p->input.p_item );
@@ -1454,12 +1451,14 @@ static void SoutKeep( sout_instance_t *p_sout )
 {
     playlist_t * p_playlist = vlc_object_find( p_sout, VLC_OBJECT_PLAYLIST,
                                                 FIND_PARENT );
-    if( !p_playlist ) return;
-
-    msg_Dbg( p_sout, "sout has been kept" );
-    vlc_object_attach( p_sout, p_playlist );
-
-    vlc_object_release( p_playlist );
+    if( p_playlist )
+    {
+        msg_Dbg( p_sout, "sout has been kept" );
+        vlc_object_attach( p_sout, p_playlist );
+        vlc_object_release( p_playlist );
+    }
+    else
+        sout_DeleteInstance( p_sout );
 }
 
 /*****************************************************************************




More information about the vlc-devel mailing list