diff options
Diffstat (limited to 'Source/SPNarrowDownCompletion.m')
-rw-r--r-- | Source/SPNarrowDownCompletion.m | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index c76c06e6..50b4e953 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -118,6 +118,8 @@ filtered = nil; spaceCounter = 0; currentSyncImage = 0; + staticPrefix = nil; + suggestions = nil; commonPrefixWasInsertedByAutoComplete = NO; prefs = [NSUserDefaults standardUserDefaults]; originalFilterString = [[NSMutableString alloc] init]; @@ -127,12 +129,12 @@ [self setupInterface]; syncArrowImages = [[NSArray alloc] initWithObjects: - [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_01" ofType:@"tiff"]], - [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_02" ofType:@"tiff"]], - [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_03" ofType:@"tiff"]], - [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_04" ofType:@"tiff"]], - [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_05" ofType:@"tiff"]], - [[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_06" ofType:@"tiff"]], + [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_01" ofType:@"tiff"]] autorelease], + [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_02" ofType:@"tiff"]] autorelease], + [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_03" ofType:@"tiff"]] autorelease], + [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_04" ofType:@"tiff"]] autorelease], + [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_05" ofType:@"tiff"]] autorelease], + [[[NSImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"sync_arrows_06" ofType:@"tiff"]] autorelease], nil]; } @@ -147,10 +149,11 @@ [stateTimer release]; } stateTimer = nil; - [staticPrefix release]; + if (staticPrefix) [staticPrefix release]; [mutablePrefix release]; [textualInputCharacters release]; [originalFilterString release]; + [syncArrowImages release]; if(suggestions) [suggestions release]; if (filtered) [filtered release]; @@ -158,6 +161,13 @@ [super dealloc]; } +- (void)close +{ + closeMe = YES; + [theView setCompletionIsOpen:NO]; + [super close]; +} + - (void)updateSyncArrowStatus { // update sync arrow image @@ -331,7 +341,7 @@ [theTableView setHeaderView:nil]; NSTableColumn *column0 = [[[NSTableColumn alloc] initWithIdentifier:@"image"] autorelease]; - [column0 setDataCell:[NSImageCell new]]; + [column0 setDataCell:[[NSImageCell new] autorelease]]; [theTableView addTableColumn:column0]; [column0 setMinWidth:0]; [column0 setWidth:20]; @@ -758,6 +768,9 @@ if(!event) continue; + + // Exit if closeMe has been set in the meantime + if(closeMe) return; NSEventType t = [event type]; if([theTableView SP_NarrowDownCompletion_canHandleEvent:event]) |