mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 03:05:55 +08:00
Fixed hard crash when deconstructing RemotePackageList while parsing
Contributes to CURA-8558
This commit is contained in:
parent
fd409215c4
commit
a0467cd66f
@ -107,8 +107,14 @@ class RemotePackageList(PackageList):
|
|||||||
return
|
return
|
||||||
|
|
||||||
for package_data in response_data["data"]:
|
for package_data in response_data["data"]:
|
||||||
package = PackageModel(package_data, parent = self)
|
try:
|
||||||
self.appendItem({"package": package}) # Add it to this list model.
|
package = PackageModel(package_data, parent = self)
|
||||||
|
self.appendItem({"package": package}) # Add it to this list model.
|
||||||
|
except RuntimeError:
|
||||||
|
# Setting the ownership of this object to not qml can still result in a RuntimeError. Which can occur when quickly toggling
|
||||||
|
# between de-/constructing RemotePackageLists. This try-except is here to prevent a hard crash when the wrapped C++ object
|
||||||
|
# was deleted when it was still parsing the response
|
||||||
|
return
|
||||||
|
|
||||||
self._request_url = response_data["links"].get("next", "") # Use empty string to signify that there is no next page.
|
self._request_url = response_data["links"].get("next", "") # Use empty string to signify that there is no next page.
|
||||||
self._ongoing_request = None
|
self._ongoing_request = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user