From 8febe85e1cb92fa7f4fc073607bd8b08f850b446 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 16 Jun 2015 00:56:55 +0200 Subject: Experimental change to see if it improves #2114 (crashes in server process list) --- Source/SPProcessListController.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/SPProcessListController.m') diff --git a/Source/SPProcessListController.m b/Source/SPProcessListController.m index 5f8a422e..e61dfc30 100644 --- a/Source/SPProcessListController.m +++ b/Source/SPProcessListController.m @@ -627,7 +627,7 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; [processList setReturnDataAsStrings:YES]; - [processes removeAllObjects]; + [[processes onMainThread] removeAllObjects]; for (i = 0; i < [processList numberOfRows]; i++) { @@ -650,7 +650,11 @@ static NSString *SPTableViewIDColumnIdentifier = @"Id"; [rowsFixed setObject:num forKey:@"Time"]; } - [processes addObject:[[rowsFixed copy] autorelease]]; + // This is pretty bad from a performance standpoint, but we must not + // interfere with the NSTableView's reload cycle and there is no way + // to know when it starts/ends. We only know it will happen on the + // main thread, so we have to interlock with that. + [[processes onMainThread] addObject:[[rowsFixed copy] autorelease]]; [rowsFixed release]; } -- cgit v1.2.3