Changeset 9302


Ignore:
Timestamp:
Oct 12, 2009, 12:48:16 AM (13 years ago)
Author:
livings124
Message:

fix a crash on quit with the QuickLook? window open

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r9298 r9302  
    9999    IBOutlet NSButton               * fURLSheetOpenButton;
    100100   
     101    #warning change to QLPreviewPanel
     102    id                              fPreviewPanel;
     103    BOOL                            fQuitting;
     104   
    101105    BOOL                            fUpdateInProgress;
    102106    BOOL                            fPauseOnLaunch;
     
    111115   
    112116    BOOL                            fSoundPlaying;
    113    
    114     #warning change to QLPreviewPanel
    115     id fPreviewPanel;
    116117}
    117118
  • trunk/macosx/Controller.m

    r9301 r9302  
    333333        fPrefsController = [[PrefsController alloc] init];
    334334       
     335        fQuitting = NO;
    335336        fSoundPlaying = NO;
    336337       
     
    666667- (void) applicationWillTerminate: (NSNotification *) notification
    667668{
     669    fQuitting = YES;
     670   
    668671    //stop the Bonjour service
    669672    [[BonjourController defaultController] stop];
     
    704707    const BOOL quickLookOpen = [NSApp isOnSnowLeopardOrBetter] && [QLPreviewPanelSL sharedPreviewPanelExists]
    705708                                && [[QLPreviewPanelSL sharedPreviewPanel] isVisible];
     709    if (quickLookOpen)
     710        [[QLPreviewPanelSL sharedPreviewPanel] updateController];
     711   
    706712    for (NSWindow * window in [NSApp windows])
    707     {
    708         if (!quickLookOpen || window != [QLPreviewPanelSL sharedPreviewPanel]) //hide quicklook window last to avoid animation
    709             [window orderOut: nil];
    710     }
    711    
    712     if (quickLookOpen)
    713     {
    714         [[QLPreviewPanelSL sharedPreviewPanel] reloadData];
    715         [[QLPreviewPanelSL sharedPreviewPanel] orderOut: nil];
    716     }
     713        [window orderOut: nil];
    717714   
    718715    [self showStatusBar: NO animate: NO];
     
    31293126- (BOOL) acceptsPreviewPanelControl: (id) panel
    31303127{
    3131     return YES;
     3128    return !fQuitting;
    31323129}
    31333130
Note: See TracChangeset for help on using the changeset viewer.