Improving stability of asynchronous LaTeX renderer.

This commit is contained in:
Adsooi 2024-10-15 03:52:06 +02:00
parent cf73b35a9a
commit 5313428250
Signed by: Ad5001
GPG key ID: EF45F9C6AFE20160
3 changed files with 18 additions and 7 deletions

View file

@ -53,7 +53,12 @@ class PyPromiseRunner(QRunnable):
raise InvalidReturnValue("Must return either a primitive, a valid QObject, JS Value, or None.")
self.promise.finished.emit(data)
except Exception as e:
self.promise.errored.emit(repr(e))
try:
self.promise.errored.emit(repr(e))
except RuntimeError as e2:
# Happens when the PyPromise has already been garbage collected.
# In other words, nothing to report to nowhere.
pass
class PyPromise(QObject):