aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <post@wickenrode.com>2015-04-22 22:30:57 +0200
committerMax <post@wickenrode.com>2015-04-22 22:30:57 +0200
commit75738e17389d9d66713fdde60cfd59774c934557 (patch)
tree77a7e78bd46ffc737d92939d20359761e26c5ea4
parent55951d00cde44cfc654a2a6cb97e941eca2eb70f (diff)
downloadsequelpro-75738e17389d9d66713fdde60cfd59774c934557.tar.gz
sequelpro-75738e17389d9d66713fdde60cfd59774c934557.tar.bz2
sequelpro-75738e17389d9d66713fdde60cfd59774c934557.zip
Fixed two case of background thread interacting with UI
aka "deleted uncommited CA transaction"
-rw-r--r--Source/SPDatabaseDocument.m5
-rw-r--r--Source/SPHistoryController.m2
-rw-r--r--Source/SPTableContent.m6
3 files changed, 9 insertions, 4 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index 506e78f6..0b4abdb9 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -4577,8 +4577,9 @@ static NSString *SPAlterDatabaseAction = @"SPAlterDatabase";
[sessionState setObject:[NSNumber numberWithBool:[tableContentInstance sortColumnIsAscending]] forKey:@"contentSortColIsAsc"];
[sessionState setObject:[NSNumber numberWithInteger:[tableContentInstance pageNumber]] forKey:@"contentPageNumber"];
[sessionState setObject:NSStringFromRect([tableContentInstance viewport]) forKey:@"contentViewport"];
- if ([tableContentInstance filterSettings])
- [sessionState setObject:[tableContentInstance filterSettings] forKey:@"contentFilter"];
+ NSDictionary *filterSettings = [tableContentInstance filterSettings];
+ if (filterSettings)
+ [sessionState setObject:filterSettings forKey:@"contentFilter"];
NSDictionary *contentSelectedRows = [tableContentInstance selectionDetailsAllowingIndexSelection:YES];
if (contentSelectedRows) {
diff --git a/Source/SPHistoryController.m b/Source/SPHistoryController.m
index aa504bc2..87cc4eab 100644
--- a/Source/SPHistoryController.m
+++ b/Source/SPHistoryController.m
@@ -276,7 +276,7 @@
NSUInteger contentPageNumber = [tableContentInstance pageNumber];
NSDictionary *contentSelectedRows = [tableContentInstance selectionDetailsAllowingIndexSelection:YES];
NSRect contentViewport = [tableContentInstance viewport];
- NSDictionary *contentFilter = [tableContentInstance filterSettings];
+ NSDictionary *contentFilter = [[tableContentInstance onMainThread] filterSettings];
NSData *filterTableData = [tableContentInstance filterTableData];
if (!theDatabase) return;
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 45add266..7b60d152 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -811,7 +811,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
[self fieldListForQuery], [selectedTable backtickQuotedString]];
// Add a filter string if appropriate
- filterString = [self tableFilterString];
+ filterString = [[self onMainThread] tableFilterString];
if (filterString) {
[queryString appendFormat:@" WHERE %@", filterString];
@@ -1071,6 +1071,8 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
* Returns the query string for the current filter settings,
* ready to be dropped into a WHERE clause, or nil if no filtering
* is active.
+ *
+ * @warning Uses UI. ONLY call from main thread!
*/
- (NSString *)tableFilterString
{
@@ -3912,6 +3914,8 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
/**
* Provide a getter for the current filter details
+ *
+ * @warning Uses UI. MUST call from main thread!
*/
- (NSDictionary *) filterSettings
{