]> git.sesse.net Git - vlc/commitdiff
Another thread-unsafe redumdant use of b_dead
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 14 Sep 2008 14:40:57 +0000 (17:40 +0300)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sun, 14 Sep 2008 14:40:57 +0000 (17:40 +0300)
modules/misc/notify/telepathy.c

index 4921d4641758af5b84e91eefb3ccd514910b9a40..3dd5eaf229a5981ad7353dfef8a57701f6a24b1b 100644 (file)
@@ -135,16 +135,9 @@ static int Open( vlc_object_t *p_this )
  *****************************************************************************/
 static void Close( vlc_object_t *p_this )
 {
-    p_this->b_dead = true;
     intf_thread_t *p_intf = (intf_thread_t *)p_this;
     playlist_t *p_playlist = pl_Yield( p_this );
 
-    /* Clears the Presence message ... else it looks like we're still playing
-     * something although VLC (or the Telepathy plugin) is closed */
-
-    /* Do not check for VLC_ENOMEM as we're closing */
-    SendToTelepathy( p_intf, "" );
-
     PL_LOCK;
     var_DelCallback( p_playlist, "item-change", ItemChange, p_intf );
     var_DelCallback( p_playlist, "playlist-current", ItemChange, p_intf );
@@ -153,6 +146,12 @@ static void Close( vlc_object_t *p_this )
     PL_UNLOCK;
     pl_Release( p_this );
 
+    /* Clears the Presence message ... else it looks like we're still playing
+     * something although VLC (or the Telepathy plugin) is closed */
+
+    /* Do not check for VLC_ENOMEM as we're closing */
+    SendToTelepathy( p_intf, "" );
+
     /* we won't use the DBus connection anymore */
     dbus_connection_unref( p_intf->p_sys->p_conn );
 
@@ -173,9 +172,6 @@ static int ItemChange( vlc_object_t *p_this, const char *psz_var,
     char *psz_buf = NULL;
     input_thread_t *p_input;
 
-    if( p_intf->b_dead )
-        return VLC_EGENERIC;
-
     /* Don't update Telepathy presence each time an item has been preparsed */
     if( !strncmp( "playlist-current", psz_var, 16 ) )
     { /* stores the current input item id */
@@ -239,8 +235,6 @@ static int StateChange( vlc_object_t *p_this, const char *psz_var,
 {
     VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(oldval);
     intf_thread_t *p_intf = (intf_thread_t *)param;
-    if( p_intf->b_dead )
-        return VLC_EGENERIC;
     if( newval.i_int >= END_S )
         return SendToTelepathy( p_intf, "" );
     return VLC_SUCCESS;