Qt5->Qt6: Fix another stack-overflow error for newer Python/Qt.

part of CURA-8591
This commit is contained in:
Remco Burema 2021-12-29 10:15:14 +01:00
parent 9d7b1e49ee
commit 97da0b9183
No known key found for this signature in database
GPG key ID: 215C49431D43F98C
2 changed files with 5 additions and 7 deletions

View file

@ -34,12 +34,13 @@ class CuraAPI(QObject):
raise RuntimeError("Tried to create singleton '{class_name}' more than once.".format(class_name = CuraAPI.__name__))
if application is None:
raise RuntimeError("Upon first time creation, the application must be set.")
cls.__instance = super(CuraAPI, cls).__new__(cls)
instance = super(CuraAPI, cls).__new__(cls)
cls._application = application
return cls.__instance
return instance
def __init__(self, application: Optional["CuraApplication"] = None) -> None:
super().__init__(parent = CuraAPI._application)
CuraAPI.__instance = self
self._account = Account(self._application)