diff options
author | Max <post@wickenrode.com> | 2015-07-20 02:12:00 +0200 |
---|---|---|
committer | Max <post@wickenrode.com> | 2015-10-02 19:30:54 +0200 |
commit | 7201cb8ac9e6f39c0b9f67af9b71b41e60410c14 (patch) | |
tree | 74a53c334873a3cae21e5092f58820bc35d8694b /Source/SPDatabaseDocument.m | |
parent | d8acb8faf2c96fd059bef0c17e03279816159447 (diff) | |
download | sequelpro-7201cb8ac9e6f39c0b9f67af9b71b41e60410c14.tar.gz sequelpro-7201cb8ac9e6f39c0b9f67af9b71b41e60410c14.tar.bz2 sequelpro-7201cb8ac9e6f39c0b9f67af9b71b41e60410c14.zip |
Fix a concurrent modification exception that could occur when duplicating a database
Diffstat (limited to 'Source/SPDatabaseDocument.m')
-rw-r--r-- | Source/SPDatabaseDocument.m | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 3b095f96..6230fa51 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -6140,7 +6140,7 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Attempt to select the specified database, and abort on failure #ifndef SP_CODA /* patch */ - if ([chooseDatabaseButton indexOfItemWithTitle:targetDatabaseName] == NSNotFound || ![mySQLConnection selectDatabase:targetDatabaseName]) + if ([[chooseDatabaseButton onMainThread] indexOfItemWithTitle:targetDatabaseName] == NSNotFound || ![mySQLConnection selectDatabase:targetDatabaseName]) #else if ( ![mySQLConnection selectDatabase:targetDatabaseName] ) #endif @@ -6153,7 +6153,12 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // Update the database list [[self onMainThread] setDatabases:self]; - SPBeginAlertSheet(NSLocalizedString(@"Error", @"error"), NSLocalizedString(@"OK", @"OK button"), nil, nil, parentWindow, self, nil, nil, [NSString stringWithFormat:NSLocalizedString(@"Unable to select database %@.\nPlease check you have the necessary privileges to view the database, and that the database still exists.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName]); + SPOnewayAlertSheet( + NSLocalizedString(@"Error", @"error"), + nil, + parentWindow, + [NSString stringWithFormat:NSLocalizedString(@"Unable to select database %@.\nPlease check you have the necessary privileges to view the database, and that the database still exists.", @"message of panel when connection to db failed after selecting from popupbutton"), targetDatabaseName] + ); } [taskPool drain]; @@ -6198,16 +6203,16 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase"; // If a the table has changed, update the selection if (![targetItemName isEqualToString:[self table]] && targetItemName) { focusOnFilter = ![tablesListInstance selectItemWithName:targetItemName]; - } + } // Ensure the window focus is on the table list or the filter as appropriate - [[tablesListInstance onMainThread] setTableListSelectability:YES]; + [[tablesListInstance onMainThread] setTableListSelectability:YES]; if (focusOnFilter) { [[tablesListInstance onMainThread] makeTableListFilterHaveFocus]; } else { [[tablesListInstance onMainThread] makeTableListHaveFocus]; } - [[tablesListInstance onMainThread] setTableListSelectability:NO]; + [[tablesListInstance onMainThread] setTableListSelectability:NO]; #endif [self endTask]; |