diff --git a/linedance-app/local/file_watcher.py b/linedance-app/local/file_watcher.py index 3f34a839..110c3b06 100644 --- a/linedance-app/local/file_watcher.py +++ b/linedance-app/local/file_watcher.py @@ -163,9 +163,18 @@ class LibraryWatcher: def stop(self): if self._observer and self._running: - self._observer.stop() - self._observer.join() self._running = False + # Stop i baggrundstråd så GUI ikke hænger + obs = self._observer + self._observer = None + def _stop(): + try: + obs.stop() + obs.join(timeout=3) + except Exception: + pass + import threading + threading.Thread(target=_stop, daemon=True).start() def add_library(self, path: str) -> int: """Tilføj et nyt bibliotek — alt kører i baggrundstråd."""