Skip to content

Commit b7b9b15

Browse files
committed
Experimental change to see if it improves #2114 (crashes in server process list)
1 parent 0a2f79c commit b7b9b15

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Source/SPProcessListController.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ - (void)_getDatabaseProcessListInBackground:(id)object;
627627

628628
[processList setReturnDataAsStrings:YES];
629629

630-
[processes removeAllObjects];
630+
[[processes onMainThread] removeAllObjects];
631631

632632
for (i = 0; i < [processList numberOfRows]; i++)
633633
{
@@ -650,7 +650,11 @@ - (void)_getDatabaseProcessListInBackground:(id)object;
650650
[rowsFixed setObject:num forKey:@"Time"];
651651
}
652652

653-
[processes addObject:[[rowsFixed copy] autorelease]];
653+
// This is pretty bad from a performance standpoint, but we must not
654+
// interfere with the NSTableView's reload cycle and there is no way
655+
// to know when it starts/ends. We only know it will happen on the
656+
// main thread, so we have to interlock with that.
657+
[[processes onMainThread] addObject:[[rowsFixed copy] autorelease]];
654658
[rowsFixed release];
655659
}
656660

0 commit comments

Comments
 (0)