aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPHistoryController.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-08-04 23:42:53 +0000
committerrowanbeentje <rowan@beent.je>2009-08-04 23:42:53 +0000
commit45d3ddf30437903045f31a30356502af91dd7a7d (patch)
tree98da573a3d1ab5eabaef1331b93bcf6e6cd3d453 /Source/SPHistoryController.m
parent4ce2164c519d4382b67255523c96c9e03f7fdcc6 (diff)
downloadsequelpro-45d3ddf30437903045f31a30356502af91dd7a7d.tar.gz
sequelpro-45d3ddf30437903045f31a30356502af91dd7a7d.tar.bz2
sequelpro-45d3ddf30437903045f31a30356502af91dd7a7d.zip
- Fix some small memory leaks when changing tables
- Fix the history navigation to correctly switch across databases without invalid history states
Diffstat (limited to 'Source/SPHistoryController.m')
-rw-r--r--Source/SPHistoryController.m14
1 files changed, 8 insertions, 6 deletions
diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m
index acd25ea0..69ec9e57 100644
--- a/Source/SPHistoryController.m
+++ b/Source/SPHistoryController.m
@@ -30,6 +30,8 @@
@implementation SPHistoryController
+@synthesize modifyingHistoryState;
+
#pragma mark Setup and teardown
/**
@@ -40,7 +42,7 @@
if (self = [super init]) {
history = [[NSMutableArray alloc] init];
historyPosition = NSNotFound;
- restoringHistoryState = NO;
+ modifyingHistoryState = NO;
}
return self;
}
@@ -134,7 +136,7 @@
{
// Don't modify anything if we're in the process of restoring an old history state
- if (restoringHistoryState) return;
+ if (modifyingHistoryState) return;
// Work out the current document details
NSString *theDatabase = [theDocument database];
@@ -217,7 +219,7 @@
return;
}
- restoringHistoryState = YES;
+ modifyingHistoryState = YES;
// Update the position and extract the history entry
historyPosition = position;
@@ -236,7 +238,7 @@
&& [[historyEntry objectForKey:@"view"] intValue] == [self currentlySelectedView] == SP_VIEW_CONTENT)
{
[tableContentInstance loadTable:[historyEntry objectForKey:@"table"]];
- restoringHistoryState = NO;
+ modifyingHistoryState = NO;
[self updateToolbarItem];
return;
}
@@ -293,7 +295,7 @@
}
}
- restoringHistoryState = NO;
+ modifyingHistoryState = NO;
[self updateToolbarItem];
}
@@ -304,7 +306,7 @@
- (void) abortEntryLoad
{
NSBeep();
- restoringHistoryState = NO;
+ modifyingHistoryState = NO;
}
@end