mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
return from Main loop on Ctrl-C/shutdown
This commit is contained in:
parent
59cff3d4c5
commit
6a4e9e8bec
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() {
|
||||
trace!("Ctrl-C received");
|
||||
if !self.shutdown {
|
||||
if let Some(ref spirc) = self.spirc {
|
||||
spirc.shutdown();
|
||||
|
@ -467,6 +468,10 @@ impl Future for Main {
|
|||
if !progress {
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
|
||||
if self.shutdown {
|
||||
return Ok(Async::Ready(()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue