Code cleanup, make sure race conditions can't happen, at least in theory.

This commit is contained in:
Storm Dragon
2025-06-20 03:10:07 -04:00
parent f4ed8da4c3
commit 64e79f6945
3 changed files with 36 additions and 24 deletions

View File

@ -57,6 +57,9 @@ class driver(soundDriver):
return
self.cancel()
self.mainloop.quit()
# Wait for the GLib MainLoop thread to finish to prevent shutdown races
if hasattr(self, 'thread') and self.thread.is_alive():
self.thread.join(timeout=2.0) # 2 second timeout to prevent hanging
def _onPlayerMessage(self, bus, message):
if not self._initialized: