Skip to content

Commit

Permalink
Run windows_repair using atexit
Browse files Browse the repository at this point in the history
Makes it even more likely the parent process quits before the restore
process starts restoring.
  • Loading branch information
kovidgoyal committed May 9, 2024
1 parent 9a2d3e6 commit ecb6173
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/calibre/gui2/main.py
Expand Up @@ -336,7 +336,8 @@ def initialize_db(self):
# On some windows systems the existing db file gets locked
# by something when running restore from the main process.
# So run the restore in a separate process.
windows_repair(self.library_path)
import atexit
atexit.register(windows_repair, self.library_path)
self.app.quit()
return
if repair_library(self.library_path):
Expand Down

0 comments on commit ecb6173

Please sign in to comment.