Driver: Fix crash on .leave() (#63)
Leaving (rather than removing) a call would cause the driver to crash as it would try to use a non-existent connection immediately after it had been invalidated. This has been tested using a modified `examples/serenity/voice_storage`, felyne, and via `cargo make ready`.
This commit is contained in:
@@ -132,12 +132,15 @@ impl Mixer {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The above action may have invalidated the connection; need to re-check!
|
||||||
|
if self.conn_active.is_some() {
|
||||||
if let Err(e) = self.cycle().and_then(|_| self.audio_commands_events()) {
|
if let Err(e) = self.cycle().and_then(|_| self.audio_commands_events()) {
|
||||||
events_failure |= e.should_trigger_interconnect_rebuild();
|
events_failure |= e.should_trigger_interconnect_rebuild();
|
||||||
conn_failure |= e.should_trigger_connect();
|
conn_failure |= e.should_trigger_connect();
|
||||||
|
|
||||||
debug!("Mixer thread cycle: {:?}", e);
|
debug!("Mixer thread cycle: {:?}", e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
match self.mix_rx.recv() {
|
match self.mix_rx.recv() {
|
||||||
Ok(m) => {
|
Ok(m) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user