Prevent crash when releasing released lock

CURA-C2
This commit is contained in:
Jaime van Kessel 2020-04-02 16:51:32 +02:00
parent c6dfb6e4cf
commit 6df2f84c07
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -92,13 +92,21 @@ class ImageReaderUI(QObject):
def onOkButtonClicked(self):
self._cancelled = False
self._ui_view.close()
self._ui_lock.release()
try:
self._ui_lock.release()
except RuntimeError:
# We don't really care if it was held or not. Just make sure it's not held now
pass
@pyqtSlot()
def onCancelButtonClicked(self):
self._cancelled = True
self._ui_view.close()
self._ui_lock.release()
try:
self._ui_lock.release()
except RuntimeError:
# We don't really care if it was held or not. Just make sure it's not held now
pass
@pyqtSlot(str)
def onWidthChanged(self, value):