Prevent crash if disconnect already happend

CL-541
This commit is contained in:
Jaime van Kessel 2017-12-21 15:14:50 +01:00
parent 9754aa5397
commit b1e9e3b8fa

View file

@ -227,7 +227,11 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
if device:
if device.isConnected():
device.disconnect()
device.connectionStateChanged.disconnect(self._onDeviceConnectionStateChanged)
try:
device.connectionStateChanged.disconnect(self._onDeviceConnectionStateChanged)
except TypeError:
# Disconnect already happened.
pass
self.discoveredDevicesChanged.emit()