This commit is contained in:
Kovid Goyal 2020-06-06 08:40:44 +05:30
parent 4d2a91ecf2
commit 7c06692233
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -246,9 +246,10 @@ class GuiLibraryBroker(LibraryBroker):
for library_id in tuple(self.loaded_dbs):
if library_id != self.gui_library_id and now - self.last_used_times[
library_id] > EXPIRED_AGE:
db = self.loaded_dbs.pop(library_id)
db.close()
db.break_cycles()
db = self.loaded_dbs.pop(library_id, None)
if db is not None:
db.close()
db.break_cycles()
def prune_loaded_dbs(self):
with self: