aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableDocument.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/TableDocument.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/TableDocument.m')
-rw-r--r--Source/TableDocument.m13
1 files changed, 10 insertions, 3 deletions
diff --git a/Source/TableDocument.m b/Source/TableDocument.m
index e6346ece..68b79a1a 100644
--- a/Source/TableDocument.m
+++ b/Source/TableDocument.m
@@ -409,8 +409,12 @@
return;
}
- // Save existing scroll position and details
- [spHistoryControllerInstance updateHistoryEntries];
+ // Save existing scroll position and details, and ensure no duplicate entries are created as table list changes
+ BOOL historyStateChanging = [spHistoryControllerInstance modifyingHistoryState];
+ if (!historyStateChanging) {
+ [spHistoryControllerInstance updateHistoryEntries];
+ [spHistoryControllerInstance setModifyingHistoryState:YES];
+ }
// show error on connection failed
if ( ![mySQLConnection selectDB:[chooseDatabaseButton titleOfSelectedItem]] ) {
@@ -429,7 +433,10 @@
[tableWindow setTitle:[NSString stringWithFormat:@"(MySQL %@) %@/%@", mySQLVersion, [self name], [self database]]];
// Add a history entry
- [spHistoryControllerInstance updateHistoryEntries];
+ if (!historyStateChanging) {
+ [spHistoryControllerInstance setModifyingHistoryState:NO];
+ [spHistoryControllerInstance updateHistoryEntries];
+ }
// Set focus to table list filter field if visible
// otherwise set focus to Table List view