From 9cc4665db860557a3bc80d9d1765ee73a8ad2113 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 9 Apr 2019 17:10:18 +0200 Subject: [PATCH] Fix crash for when resetDownload is called after a long wait CURA-6448 --- plugins/Toolbox/src/Toolbox.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/src/Toolbox.py b/plugins/Toolbox/src/Toolbox.py index f204445218..085c5d1bde 100644 --- a/plugins/Toolbox/src/Toolbox.py +++ b/plugins/Toolbox/src/Toolbox.py @@ -561,7 +561,13 @@ class Toolbox(QObject, Extension): self._download_reply.downloadProgress.disconnect(self._onDownloadProgress) except (TypeError, RuntimeError): # Raised when the method is not connected to the signal yet. pass # Don't need to disconnect. - self._download_reply.abort() + try: + self._download_reply.abort() + except RuntimeError: + # In some cases the garbage collector is a bit to agressive, which causes the dowload_reply + # to be deleted (especially if the machine has been put to sleep). As we don't know what exactly causes + # this (The issue probably lives in the bowels of (py)Qt somewhere), we can only catch and ignore it. + pass self._download_reply = None self._download_request = None self.setDownloadProgress(0)