mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Try to address crashes on shutdown
I was able to reproduce the crashes fairly reliably by opening the prefs screen on startup and shutting down the app after 600ms; after this change the crashes no longer seem to occur.
This commit is contained in:
parent
df38bc627c
commit
509e0a9811
1 changed files with 10 additions and 1 deletions
|
@ -519,7 +519,16 @@ class AnkiQt(QMainWindow):
|
|||
self.mediaServer.shutdown()
|
||||
# Rust background jobs are not awaited implicitly
|
||||
self.backend.await_backup_completion()
|
||||
self.app.exit(0)
|
||||
self.deleteLater()
|
||||
app = self.app
|
||||
|
||||
def exit():
|
||||
# try to ensure Qt objects are deleted in a logical order,
|
||||
# to prevent crashes on shutdown
|
||||
gc.collect()
|
||||
app.exit(0)
|
||||
|
||||
self.progress.single_shot(100, exit, False)
|
||||
|
||||
# Sound/video
|
||||
##########################################################################
|
||||
|
|
Loading…
Reference in a new issue