mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 12:09:00 +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.isConnected():
|
||||
device.disconnect()
|
||||
device.connectionStateChanged.disconnect(self._onDeviceConnectionStateChanged)
|
||||
try:
|
||||
device.connectionStateChanged.disconnect(self._onDeviceConnectionStateChanged)
|
||||
except TypeError:
|
||||
# Disconnect already happened.
|
||||
pass
|
||||
|
||||
self.discoveredDevicesChanged.emit()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user