mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
Don't clear the user-defined function list until after the DB is actually closed. This order prevents problems in plugins that run just before closing the db, e.g., library closed plugins.
It is possible that a better fix is to move the two lines of code into db.cache.close(). I looked for unwanted side effects and didn't see any, but I didnt want to make the more invasive change.
This commit is contained in:
parent
e44ca5f067
commit
88edeb42ad
1 changed files with 2 additions and 3 deletions
|
|
@ -634,9 +634,6 @@ def library_moved(self, newloc, copy_structure=False, call_close=True,
|
|||
olddb = self.library_view.model().db
|
||||
if copy_structure:
|
||||
default_prefs = olddb.prefs
|
||||
|
||||
from calibre.utils.formatter_functions import unload_user_template_functions
|
||||
unload_user_template_functions(olddb.library_id)
|
||||
except:
|
||||
olddb = None
|
||||
try:
|
||||
|
|
@ -688,6 +685,8 @@ def library_moved(self, newloc, copy_structure=False, call_close=True,
|
|||
try:
|
||||
if call_close:
|
||||
olddb.close()
|
||||
from calibre.utils.formatter_functions import unload_user_template_functions
|
||||
unload_user_template_functions(olddb.library_id)
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
|
|
|||
Loading…
Reference in a new issue