diff options
author | rowanbeentje <rowan@beent.je> | 2009-08-04 23:42:53 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-08-04 23:42:53 +0000 |
commit | 45d3ddf30437903045f31a30356502af91dd7a7d (patch) | |
tree | 98da573a3d1ab5eabaef1331b93bcf6e6cd3d453 /Source/TableDocument.m | |
parent | 4ce2164c519d4382b67255523c96c9e03f7fdcc6 (diff) | |
download | sequelpro-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.m | 13 |
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 |