Changeset 00dbcd22a3ad188806a35c56f75b75b86cdab8a6

Show
Ignore:
Timestamp:
01/04/08 01:28:23 (6 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1207006103 +0200
git-parent:

[6837b438b92d581165056c93c4f1972757496f78]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1207005954 +0200
Message:

playlist: Proper locking when editing playlist variable in loadsave.c. Also correctly release p_ml_onelevel->p_input and p_ml_category->p_input when changing them.

This fixes partly make check and input items leaks.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/playlist/loadsave.c

    rcf5667b r00dbcd2  
    149149        goto error; 
    150150 
     151    PL_LOCK; 
     152    if( p_playlist->p_ml_onelevel->p_input ) 
     153        vlc_gc_decref( p_playlist->p_ml_onelevel->p_input ); 
     154    if( p_playlist->p_ml_category->p_input ) 
     155        vlc_gc_decref( p_playlist->p_ml_category->p_input ); 
     156 
    151157    p_playlist->p_ml_onelevel->p_input = 
    152158    p_playlist->p_ml_category->p_input = p_input; 
    153  
    154159    vlc_gc_incref( p_input ); 
     160    PL_UNLOCK; 
    155161 
    156162    vlc_event_attach( &p_input->event_manager, vlc_InputItemSubItemAdded, 
    157163                        input_item_subitem_added, p_playlist ); 
    158164 
     165    PL_LOCK; 
    159166    p_playlist->b_doing_ml = VLC_TRUE; 
     167    PL_UNLOCK; 
     168 
    160169    stats_TimerStart( p_playlist, "ML Load", STATS_TIMER_ML_LOAD ); 
    161170    input_Read( p_playlist, p_input, VLC_TRUE ); 
    162171    stats_TimerStop( p_playlist,STATS_TIMER_ML_LOAD ); 
     172 
     173    PL_LOCK; 
    163174    p_playlist->b_doing_ml = VLC_FALSE; 
     175    PL_UNLOCK; 
    164176 
    165177    vlc_event_detach( &p_input->event_manager, vlc_InputItemSubItemAdded,