mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +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) {
|
pub fn start(&mut self) {
|
||||||
loop {
|
loop {
|
||||||
let msg = self.port.recv();
|
let msg = self.port.try_recv();
|
||||||
self.handle_msg(msg);
|
match msg {
|
||||||
|
Some (msg) => self.handle_msg(msg),
|
||||||
|
None => break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue