mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 06:45:57 +08:00
Prevent crash if disconnect already happend
CL-541
This commit is contained in:
parent
9754aa5397
commit
b1e9e3b8fa
@ -227,7 +227,11 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
|
|||||||
if device:
|
if device:
|
||||||
if device.isConnected():
|
if device.isConnected():
|
||||||
device.disconnect()
|
device.disconnect()
|
||||||
|
try:
|
||||||
device.connectionStateChanged.disconnect(self._onDeviceConnectionStateChanged)
|
device.connectionStateChanged.disconnect(self._onDeviceConnectionStateChanged)
|
||||||
|
except TypeError:
|
||||||
|
# Disconnect already happened.
|
||||||
|
pass
|
||||||
|
|
||||||
self.discoveredDevicesChanged.emit()
|
self.discoveredDevicesChanged.emit()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user