diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 5b3966c35a..7f99a9f0f8 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -336,7 +336,8 @@ class GuiRunner(QObject): # 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):