mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-04-30 12:40:47 -04:00
Explicitly close smartdevice during shutdown
This commit is contained in:
parent
7121d29281
commit
14f49ea4cc
@ -14,13 +14,12 @@ import random
|
||||
import select
|
||||
import socket
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import traceback
|
||||
from collections import defaultdict
|
||||
from errno import EAGAIN, EINTR
|
||||
from functools import wraps
|
||||
from threading import Thread
|
||||
from threading import RLock, Thread
|
||||
|
||||
from calibre import prints
|
||||
from calibre.constants import DEBUG, cache_dir, numeric_version
|
||||
@ -62,8 +61,7 @@ def synchronous(tlockname):
|
||||
class ConnectionListener(Thread):
|
||||
|
||||
def __init__(self, driver):
|
||||
Thread.__init__(self)
|
||||
self.daemon = True
|
||||
super().__init__(name='SmartDeviceConnectionListener', daemon=True)
|
||||
self.driver = driver
|
||||
self.keep_running = True
|
||||
self.all_ip_addresses = {}
|
||||
@ -384,7 +382,7 @@ class SMART_DEVICE_APP(DeviceConfig, DevicePlugin):
|
||||
}
|
||||
|
||||
def __init__(self, path):
|
||||
self.sync_lock = threading.RLock()
|
||||
self.sync_lock = RLock()
|
||||
self.noop_counter = 0
|
||||
self.noop_time = time.monotonic()
|
||||
self.debug_start_time = time.time()
|
||||
|
||||
@ -1242,6 +1242,8 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
|
||||
st = monotonic()
|
||||
timed_print('Shutdown starting...')
|
||||
self.shutting_down = True
|
||||
if (dm := self.device_manager).is_running('smartdevice'):
|
||||
dm.stop_plugin('smartdevice')
|
||||
if hasattr(self.library_view, 'connect_to_book_display_timer'):
|
||||
self.library_view.connect_to_book_display_timer.stop()
|
||||
self.shutdown_started.emit()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user