mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
make sure we swallow the exception when closing
otherwise the main window sticks around with no collection
This commit is contained in:
parent
4467b7c991
commit
194c02ed16
1 changed files with 9 additions and 6 deletions
15
aqt/main.py
15
aqt/main.py
|
@ -338,15 +338,18 @@ Debug info:
|
|||
corrupt = self.col.db.scalar("pragma integrity_check") != "ok"
|
||||
except:
|
||||
corrupt = True
|
||||
try:
|
||||
self.col.close()
|
||||
except:
|
||||
corrupt = True
|
||||
finally:
|
||||
self.col = None
|
||||
if corrupt:
|
||||
showWarning(_("Your collection file appears to be corrupt. \
|
||||
This can happen when the file is copied or moved while Anki is open, or \
|
||||
when the collection is stored on a network or cloud drive. Please see \
|
||||
the manual for information on how to restore from an automatic backup."))
|
||||
try:
|
||||
self.col.close()
|
||||
finally:
|
||||
self.col = None
|
||||
when the collection is stored on a network or cloud drive. If problems \
|
||||
persist after restarting your computer, please open an automatic backup \
|
||||
from the profile screen."))
|
||||
if not corrupt and not self.restoringBackup:
|
||||
self.backup()
|
||||
|
||||
|
|
Loading…
Reference in a new issue