Changeset f0dc54ba5d8a5219692b5fac17fe26a4eb11eadd

Show
Ignore:
Timestamp:
05/10/07 14:24:23 (1 year ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1178799863 +0000
git-parent:

[02c82b36dc009c3cb2c09058ae73c40d4a1485a0]

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

Mac OS X gui: Fix a crash when waking up from sleep.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/macosx/playlist.m

    r0e08126 rf0dc54b  
    238238    id o_value = nil; 
    239239    playlist_item_t *p_item; 
    240      
    241     if( item == nil || ![item isKindOfClass: [NSValue class]] ) return( @"error" ); 
     240 
     241    /* For error handling */ 
     242    static BOOL attempted_reload = NO; 
     243 
     244    if( item == nil || ![item isKindOfClass: [NSValue class]] ) 
     245    { 
     246        /* Attempt to fix the error by asking for a data redisplay 
     247         * This might cause infinite loop, so add a small check */ 
     248        if( !attempted_reload ) 
     249        { 
     250            attempted_reload = YES; 
     251            [outlineView reloadData]; 
     252        } 
     253        return @"error" ; 
     254    } 
    242255     
    243256    p_item = (playlist_item_t *)[item pointerValue]; 
    244     if( p_item == NULL ) 
    245     { 
    246         return( @"error"); 
     257    if( !p_item || !p_item->p_input ) 
     258    { 
     259        /* Attempt to fix the error by asking for a data redisplay 
     260         * This might cause infinite loop, so add a small check */ 
     261        if( !attempted_reload ) 
     262        { 
     263            attempted_reload = YES; 
     264            [outlineView reloadData]; 
     265        } 
     266        return @"error"; 
    247267    } 
    248268     
     269    attempted_reload = NO; 
     270 
    249271    if( [[o_tc identifier] isEqualToString:@"1"] ) 
    250272    {