mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
ensure collection doesn't get stuck open if loading fails
This commit is contained in:
parent
f592672fa9
commit
0bb80329e8
1 changed files with 5 additions and 7 deletions
|
@ -482,13 +482,11 @@ close the profile or restart Anki."""
|
||||||
tr(TR.ERRORS_UNABLE_OPEN_COLLECTION) + "\n" + traceback.format_exc()
|
tr(TR.ERRORS_UNABLE_OPEN_COLLECTION) + "\n" + traceback.format_exc()
|
||||||
)
|
)
|
||||||
# clean up open collection if possible
|
# clean up open collection if possible
|
||||||
if self.col:
|
try:
|
||||||
try:
|
self.backend.close_collection(False)
|
||||||
self.col.close(save=False, downgrade=False)
|
except Exception as e:
|
||||||
except:
|
print("unable to close collection:", e)
|
||||||
pass
|
self.col = None
|
||||||
self.col = None
|
|
||||||
|
|
||||||
# return to profile manager
|
# return to profile manager
|
||||||
self.hide()
|
self.hide()
|
||||||
self.showProfileManager()
|
self.showProfileManager()
|
||||||
|
|
Loading…
Reference in a new issue