mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Merge pull request #212 from lrbalt/shutdown
return from Main loop on Ctrl-C/shutdown
This commit is contained in:
commit
92835af007
1 changed files with 5 additions and 0 deletions
|
@ -434,6 +434,7 @@ impl Future for Main {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Async::Ready(Some(())) = self.signal.poll().unwrap() {
|
if let Async::Ready(Some(())) = self.signal.poll().unwrap() {
|
||||||
|
trace!("Ctrl-C received");
|
||||||
if !self.shutdown {
|
if !self.shutdown {
|
||||||
if let Some(ref spirc) = self.spirc {
|
if let Some(ref spirc) = self.spirc {
|
||||||
spirc.shutdown();
|
spirc.shutdown();
|
||||||
|
@ -467,6 +468,10 @@ impl Future for Main {
|
||||||
if !progress {
|
if !progress {
|
||||||
return Ok(Async::NotReady);
|
return Ok(Async::NotReady);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.shutdown {
|
||||||
|
return Ok(Async::Ready(()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue