mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Ensure deleted cache objects are closed
Also ensure close is only called once
This commit is contained in:
parent
be83f8bfa6
commit
f65a05cc8f
@ -2355,8 +2355,14 @@ class Cache:
|
|||||||
def vacuum(self):
|
def vacuum(self):
|
||||||
self.backend.vacuum()
|
self.backend.vacuum()
|
||||||
|
|
||||||
|
def __del__(self):
|
||||||
|
self.close()
|
||||||
|
|
||||||
@write_api
|
@write_api
|
||||||
def close(self):
|
def close(self):
|
||||||
|
if hasattr(self, 'close_called'):
|
||||||
|
return
|
||||||
|
self.close_called = True
|
||||||
self.shutting_down = True
|
self.shutting_down = True
|
||||||
self.event_dispatcher.close()
|
self.event_dispatcher.close()
|
||||||
if self.fts_queue_thread is not None:
|
if self.fts_queue_thread is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user