From 1d01c5f26258a0b78aa38d6686c1f2e35c285c13 Mon Sep 17 00:00:00 2001 From: Taiko2k Date: Tue, 3 Dec 2024 13:58:25 +1300 Subject: [PATCH] fix more lock warnings --- src/tauon/t_modules/t_main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tauon/t_modules/t_main.py b/src/tauon/t_modules/t_main.py index b7a497285..29048b7ee 100644 --- a/src/tauon/t_modules/t_main.py +++ b/src/tauon/t_modules/t_main.py @@ -5354,7 +5354,8 @@ def notify_update_fire(self) -> None: def notify_update(self, mpris: bool = True) -> None: tauon.tray_releases += 1 try: - tauon.tray_lock.release() + if tauon.tray_lock.locked(): + tauon.tray_lock.release() except RuntimeError as e: if str(e) == "release unlocked lock": logging.error("RuntimeError: Attempted to release already unlocked tray_lock") @@ -48595,7 +48596,8 @@ def drop_file(target): time.sleep(2) try: - tm.player_lock.release() + if tm.player_lock.locked(): + tm.player_lock.release() except RuntimeError as e: if str(e) == "release unlocked lock": logging.error("RuntimeError: Attempted to release already unlocked player_lock")