Catch runtime errors when trying to disconnect signal

Contribute to CURA-8587
This commit is contained in:
Jelle Spijker 2021-12-16 17:07:42 +01:00
parent 0a7aee5c09
commit 4d8592c6b7
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
2 changed files with 9 additions and 3 deletions

View file

@ -55,8 +55,11 @@ class PackageList(ListModel):
def __del__(self) -> None:
""" When this object is deleted it will loop through all registered API requests and aborts them """
self.cleanUpAPIRequest()
self.isLoadingChanged.disconnect()
self.hasMoreChanged.disconnect()
try:
self.isLoadingChanged.disconnect()
self.hasMoreChanged.disconnect()
except RuntimeError:
pass
def abortRequest(self, request_id: str) -> None:
"""Aborts a single request"""