Add documentation and further specify except around disconnecting signals

Catch just a TypeError instead of all exceptions. Added documentation to say why we catch a TypeError there. Also splitted up the try-except block for the 3 disconnects, just so that if the first fails we still try to disconnect from the other two.

Contributes to issue CURA-3497.
This commit is contained in:
Ghostkeeper 2017-05-03 14:56:52 +02:00
parent d95488a940
commit 86f1a0559f
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75
2 changed files with 8 additions and 2 deletions

View file

@ -185,7 +185,7 @@ class PrintInformation(QObject):
if self._active_material_container:
try:
self._active_material_container.metaDataChanged.disconnect(self._onMaterialMetaDataChanged)
except TypeError:
except TypeError: #pyQtSignal gives a TypeError when disconnecting from something that is already disconnected.
pass
active_material_id = Application.getInstance().getMachineManager().activeMaterialId