Skip to content

Fix minor bugs with queue and teardown - #83

Open
larsoner wants to merge 1 commit into
spatialaudio:masterfrom
larsoner:queue
Open

larsoner wants to merge 1 commit into
spatialaudio:masterfrom
larsoner:queue

Conversation

@larsoner

Copy link
Copy Markdown
Collaborator

Fix a few minor bugs I came across:

  1. Protect memset call for input-only streams
  2. Add a __del__ for mixers that ensure they are closed. Otherwise a garbage-collected mixer could keep calling a callback with a freed state.
  3. Have the cancel action keep the action alive in the meantime, otherwise the callback could potentially read freed memory
  4. Probably the most useful for me personally -- raise a RuntimeError if you try to enqueue an action and it would otherwise be silently ignored because the queue is full.

Bumped the PortAudio dep while I was in there. I found these because I asked Claude Opus 5.5 to investigate queue / PortAudio use since I've occasionally in CIs seen failures related to a queue being full. Opus made some suggestions, I had it implement them, and I reviewed and vouch for them. They all seem like reasonable / useful hardenings to me.

(This repo has no agentic guidance and we probably don't need it yet, but happy to talk more about it if desired. In MNE-Python we've had some nice improvements in terms of efficiency and bugs by having experts use it IMO, so I'll use it a bit here, too, to make little fixes/improvements unless there are objections! I could for example have it add some minimal unit tests, which could help us find some bugs as well.)

This branch has not been deployed

No deployments
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