Don't iterate over all system processes (#11281)

Release Notes:

- Fixed a UI beachball when gathering process information
This commit is contained in:
Conrad Irwin 2024-05-01 20:08:56 -06:00 committed by GitHub
parent 3b5fd4ea66
commit b487f2ce6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 34 deletions

View file

@ -98,8 +98,14 @@ impl PtyProcessInfo {
fn refresh(&mut self) -> Option<&Process> {
let pid = self.pid_getter.pid()?;
self.system.refresh_processes_specifics(self.refresh_kind);
self.system.process(pid)
if self
.system
.refresh_process_specifics(pid, self.refresh_kind)
{
self.system.process(pid)
} else {
None
}
}
fn load(&mut self) -> Option<ProcessInfo> {