diff options
-rw-r--r-- | Source/SPHistoryController.h | 2 | ||||
-rw-r--r-- | Source/SPHistoryController.m | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/Source/SPHistoryController.h b/Source/SPHistoryController.h index 56303807..1b5ecaf3 100644 --- a/Source/SPHistoryController.h +++ b/Source/SPHistoryController.h @@ -64,7 +64,7 @@ enum sphistory_view_types // Loading history entries - (void) loadEntryAtPosition:(unsigned int)position; - (void) loadEntryTaskWithPosition:(NSNumber *)positionNumber; -- (void) abortEntryLoad; +- (void) abortEntryLoadWithPool:(NSAutoreleasePool *)pool; - (void) loadEntryFromMenuItem:(id)theMenuItem; // History entry details and description diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m index 7644f97f..17f2d3d7 100644 --- a/Source/SPHistoryController.m +++ b/Source/SPHistoryController.m @@ -301,6 +301,8 @@ [tableContentInstance loadTable:[historyEntry objectForKey:@"table"]]; modifyingHistoryState = NO; [self updateToolbarItem]; + [theDocument endTask]; + [loadPool drain]; return; } @@ -314,7 +316,7 @@ [chooseDatabaseButton selectItemWithTitle:[historyEntry objectForKey:@"database"]]; [theDocument chooseDatabase:self]; if (![[theDocument database] isEqualToString:[historyEntry objectForKey:@"database"]]) { - return [self abortEntryLoad]; + return [self abortEntryLoadWithPool:loadPool]; } } @@ -322,11 +324,11 @@ if ([historyEntry objectForKey:@"table"] && ![[theDocument table] isEqualToString:[historyEntry objectForKey:@"table"]]) { NSArray *tables = [tablesListInstance tables]; if ([tables indexOfObject:[historyEntry objectForKey:@"table"]] == NSNotFound) { - return [self abortEntryLoad]; + return [self abortEntryLoadWithPool:loadPool]; } [[tablesListInstance valueForKey:@"tablesListView"] selectRowIndexes:[NSIndexSet indexSetWithIndex:[tables indexOfObject:[historyEntry objectForKey:@"table"]]] byExtendingSelection:NO]; if (![[theDocument table] isEqualToString:[historyEntry objectForKey:@"table"]]) { - return [self abortEntryLoad]; + return [self abortEntryLoadWithPool:loadPool]; } } else if (![historyEntry objectForKey:@"table"] && [theDocument table]) { [tablesListInstance setTableListSelectability:YES]; @@ -355,7 +357,7 @@ break; } if ([self currentlySelectedView] != [[historyEntry objectForKey:@"view"] intValue]) { - return [self abortEntryLoad]; + return [self abortEntryLoadWithPool:loadPool]; } } @@ -371,10 +373,12 @@ * Convenience method for aborting history load - could at some point * clean up the history list, show an alert, etc */ -- (void) abortEntryLoad +- (void) abortEntryLoadWithPool:(NSAutoreleasePool *)pool { NSBeep(); modifyingHistoryState = NO; + [theDocument endTask]; + if (pool) [pool drain]; } /** |