Skip to content
Snippets Groups Projects
Commit 690c5d28 authored by George Nachman's avatar George Nachman
Browse files

Fix race condition that threw an exception in ProcessCache when...

Fix race condition that threw an exception in ProcessCache when getNameOfPid:isForeground returned nil.
parent d1d66e28
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -288,10 +288,12 @@ NSString *PID_INFO_NAME = @"name";
BOOL isForeground;
NSString* name = [self getNameOfPid:thePid isForeground:&isForeground];
if (isForeground) {
[temp setObject:name forKey:[NSNumber numberWithInt:thePid]];
if (name) {
if (isForeground) {
[temp setObject:name forKey:[NSNumber numberWithInt:thePid]];
}
[ancestry setObject:[NSNumber numberWithInt:ppid] forKey:n];
}
[ancestry setObject:[NSNumber numberWithInt:ppid] forKey:n];
}
// For each pid in 'temp', follow the parent pid chain in 'ancestry' and add a map of
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment