Changeset 00dbcd22a3ad188806a35c56f75b75b86cdab8a6
- 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
| rcf5667b |
r00dbcd2 |
|
| 149 | 149 | goto error; |
|---|
| 150 | 150 | |
|---|
| | 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 | |
|---|
| 151 | 157 | p_playlist->p_ml_onelevel->p_input = |
|---|
| 152 | 158 | p_playlist->p_ml_category->p_input = p_input; |
|---|
| 153 | | |
|---|
| 154 | 159 | vlc_gc_incref( p_input ); |
|---|
| | 160 | PL_UNLOCK; |
|---|
| 155 | 161 | |
|---|
| 156 | 162 | vlc_event_attach( &p_input->event_manager, vlc_InputItemSubItemAdded, |
|---|
| 157 | 163 | input_item_subitem_added, p_playlist ); |
|---|
| 158 | 164 | |
|---|
| | 165 | PL_LOCK; |
|---|
| 159 | 166 | p_playlist->b_doing_ml = VLC_TRUE; |
|---|
| | 167 | PL_UNLOCK; |
|---|
| | 168 | |
|---|
| 160 | 169 | stats_TimerStart( p_playlist, "ML Load", STATS_TIMER_ML_LOAD ); |
|---|
| 161 | 170 | input_Read( p_playlist, p_input, VLC_TRUE ); |
|---|
| 162 | 171 | stats_TimerStop( p_playlist,STATS_TIMER_ML_LOAD ); |
|---|
| | 172 | |
|---|
| | 173 | PL_LOCK; |
|---|
| 163 | 174 | p_playlist->b_doing_ml = VLC_FALSE; |
|---|
| | 175 | PL_UNLOCK; |
|---|
| 164 | 176 | |
|---|
| 165 | 177 | vlc_event_detach( &p_input->event_manager, vlc_InputItemSubItemAdded, |
|---|