mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +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() {
|
||||
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