Skip to content

Conversation

@vidonnus
Copy link

Summary

  • Make WindowsSocket, UnixSocket, and EventHandler threads daemon threads

Problem

When MPV is killed externally (e.g., Cmd+Q on macOS), the non-daemon threads block on I/O operations (socket.recv(), queue.get()) and Python's interpreter shutdown waits for them indefinitely. This causes applications using this library to hang for minutes until MPV fully exits.

Solution

Setting self.daemon = True on all internal threads allows Python to exit cleanly without waiting for these threads to finish.

When MPV is killed externally, non-daemon threads block on I/O operations
and Python's interpreter shutdown waits for them indefinitely. Setting
daemon=True allows Python to exit cleanly without waiting for these threads.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant