Skip to content

Commit

Permalink
Apply changes from e1b881b to SPTableContent (part of #2770)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmoagx committed May 14, 2017
1 parent f603e3f commit 5c717e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion Source/SPTableContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@
BOOL _mainNibLoaded;
BOOL isWorking;
pthread_mutex_t tableValuesLock;
NSCondition *tableLoadingCondition;
#ifndef SP_CODA
NSMutableArray *nibObjectsToRelease;
#endif
Expand Down
12 changes: 2 additions & 10 deletions Source/SPTableContent.m
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ - (id)init
usedQuery = [[NSString alloc] initWithString:@""];

tableLoadTimer = nil;
tableLoadingCondition = [NSCondition new];

blackColor = [NSColor blackColor];
lightGrayColor = [NSColor lightGrayColor];
Expand Down Expand Up @@ -1056,11 +1055,8 @@ - (void)updateResultStore:(SPMySQLStreamingResultStore *)theResultStore approxim
// Set up the table updates timer and wait for it to notify this thread about completion
[[self onMainThread] initTableLoadTimer];

[tableLoadingCondition lock];
while (![tableValues dataDownloaded]) {
[tableLoadingCondition waitUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.05]];
}
[tableLoadingCondition unlock];
[tableValues awaitDataDownloaded];

tableRowsCount = [tableValues count];

// If the final column autoresize wasn't performed, perform it
Expand Down Expand Up @@ -1265,10 +1261,7 @@ - (void) tableLoadUpdate:(NSTimer *)theTimer
}

if ([tableValues dataDownloaded]) {
[tableLoadingCondition lock];
[tableLoadingCondition signal];
[self clearTableLoadTimer];
[tableLoadingCondition unlock];
}

// Check whether a table update is required, based on whether new rows are
Expand Down Expand Up @@ -4226,7 +4219,6 @@ - (void)dealloc
if(fieldEditor) SPClear(fieldEditor);

[self clearTableLoadTimer];
SPClear(tableLoadingCondition);
SPClear(tableValues);
pthread_mutex_destroy(&tableValuesLock);
SPClear(dataColumns);
Expand Down

0 comments on commit 5c717e0

Please sign in to comment.