Reset shared HTTP clients on startup to prevent event loop closed error
Cacheless mode closes the app while clients may still reference the old event loop. Resetting to None on startup forces fresh client creation on the new event loop.
This commit is contained in:
parent
9c07fbd880
commit
602a71d534
@ -227,6 +227,13 @@ class BooruApp(QMainWindow):
|
||||
self._async_thread = threading.Thread(target=self._async_loop.run_forever, daemon=True)
|
||||
self._async_thread.start()
|
||||
|
||||
# Reset shared HTTP clients from previous session
|
||||
from ..core.cache import _get_shared_client
|
||||
from ..core.api.base import BooruClient
|
||||
BooruClient._shared_client = None
|
||||
import booru_viewer.core.cache as _cache_mod
|
||||
_cache_mod._shared_client = None
|
||||
|
||||
self._setup_signals()
|
||||
self._setup_ui()
|
||||
self._setup_menu()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user