Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fix a race reported by ThreadSanitizer
- Loading branch information
Showing
with
11 additions
and
7 deletions.
-
+11
−7
Source/SPTableContent.m
|
@@ -985,11 +985,13 @@ - (void) loadTableValues |
|
|
// Update the rows count as necessary |
|
|
[self updateNumberOfRows]; |
|
|
|
|
|
// Set the filter text |
|
|
[self updateCountText]; |
|
|
|
|
|
// Update pagination |
|
|
[[self onMainThread] updatePaginationState]; |
|
|
SPMainQSync(^{ |
|
|
// Set the filter text |
|
|
[self updateCountText]; |
|
|
|
|
|
// Update pagination |
|
|
[self updatePaginationState]; |
|
|
}); |
|
|
|
|
|
// Retrieve and cache the column definitions for editing views |
|
|
if (cqColumnDefinition) [cqColumnDefinition release]; |
|
@@ -1163,6 +1165,8 @@ - (NSString *)tableFilterString |
|
|
|
|
|
/** |
|
|
* Update the table count/selection text |
|
|
* |
|
|
* MUST BE CALLED ON THE UI THREAD! |
|
|
*/ |
|
|
- (void)updateCountText |
|
|
{ |
|
@@ -1208,7 +1212,7 @@ - (void)updateCountText |
|
|
} |
|
|
|
|
|
// If rows are selected, append selection count |
|
|
NSInteger selectedRows = [[tableContentView onMainThread] numberOfSelectedRows]; // -numberOfSelectedRows is a UI method! |
|
|
NSInteger selectedRows = [tableContentView numberOfSelectedRows]; // -numberOfSelectedRows is a UI method! |
|
|
if (selectedRows > 0) { |
|
|
[countString appendString:@"; "]; |
|
|
if (selectedRows == 1) |
|
@@ -1219,7 +1223,7 @@ - (void)updateCountText |
|
|
} |
|
|
|
|
|
#ifndef SP_CODA |
|
|
[[countText onMainThread] setStringValue:countString]; |
|
|
[countText setStringValue:countString]; |
|
|
#endif |
|
|
} |
|
|
|
|
|