Skip to content

Commit 7600ad7

Browse files
committed
hotfix: fix infinite loop
1 parent 0c629f0 commit 7600ad7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/utils/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ pub fn process_child_process(enable: Option<bool>, main_pid: u32) -> windows_res
4141
));
4242
let in_process_tree = |mut pid: u32| {
4343
while let Some(&&parent_pid) = relations.get(&pid) {
44+
if parent_pid == 0 {
45+
return false;
46+
}
4447
if parent_pid == main_pid {
4548
return true;
4649
}

0 commit comments

Comments
 (0)