aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/SPDatabaseDocument.m1
-rw-r--r--Source/SPTableContent.m9
2 files changed, 4 insertions, 6 deletions
diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m
index faabb2a8..eb99fe2c 100644
--- a/Source/SPDatabaseDocument.m
+++ b/Source/SPDatabaseDocument.m
@@ -1429,6 +1429,7 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0;
// Decrement the working level
_isWorkingLevel--;
+ assert(_isWorkingLevel >= 0);
// Ensure cancellation interface is reset
[self disableTaskCancellation];
diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m
index 905e9f48..0be238ba 100644
--- a/Source/SPTableContent.m
+++ b/Source/SPTableContent.m
@@ -314,17 +314,14 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
// If no table has been supplied, clear the table interface and return
if (!aTable || [aTable isEqualToString:@""]) {
- [self performSelectorOnMainThread:@selector(setTableDetails:) withObject:nil waitUntilDone:YES];
-
+ [[self onMainThread] setTableDetails:nil];
return;
}
// Attempt to retrieve the table encoding; if that fails (indicating an error occurred
// while retrieving table data), or if the Rows variable is null, clear and return
if (![tableDataInstance tableEncoding] || [[[tableDataInstance statusValues] objectForKey:@"Rows"] isNSNull]) {
- [self performSelectorOnMainThread:@selector(setTableDetails:) withObject:nil waitUntilDone:YES];
- [tableDocumentInstance performSelectorOnMainThread:@selector(endTask) withObject:nil waitUntilDone:YES];
-
+ [[self onMainThread] setTableDetails:nil];
return;
}
@@ -338,7 +335,7 @@ static NSString *SPTableFilterSetDefaultOperator = @"SPTableFilterSetDefaultOper
[tableDataInstance columnNames], @"columnNames",
[tableDataInstance getConstraints], @"constraints",
nil];
- [self performSelectorOnMainThread:@selector(setTableDetails:) withObject:tableDetails waitUntilDone:YES];
+ [[self onMainThread] setTableDetails:tableDetails];
// Init copyTable with necessary information for copying selected rows as SQL INSERT
[tableContentView setTableInstance:self withTableData:tableValues withColumns:dataColumns withTableName:selectedTable withConnection:mySQLConnection];