Fix small bug in PulseAudio.
If the PulseAudioContext cannot connect, we should not wait trying to disconnect
it in its delete method. Only disconnect it if succesfully connected previoulsy.
@@ -220,6 +220,7 @@ class PulseAudioContext(PulseAudioLockable):
"""Completely shut down pulseaudio client."""
if self._pa_context is not None:
assert _debug("PulseAudioContext.delete")
+ if self.is_ready:
pa.pa_context_disconnect(self._pa_context)
while self.state is not None and not self.is_terminated:
