mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Change the profiler loop to use try_recv so that the task
will exit during shutdown instead of crashing trying to recv on a closed port.
This commit is contained in:
parent
a074267e23
commit
ecfa798abc
1 changed files with 5 additions and 2 deletions
|
@ -131,8 +131,11 @@ impl Profiler {
|
|||
|
||||
pub fn start(&mut self) {
|
||||
loop {
|
||||
let msg = self.port.recv();
|
||||
self.handle_msg(msg);
|
||||
let msg = self.port.try_recv();
|
||||
match msg {
|
||||
Some (msg) => self.handle_msg(msg),
|
||||
None => break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue