Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic when shutting down windowing by close button #387

Closed
cybersoulK opened this issue Nov 13, 2023 · 2 comments · Fixed by #394
Closed

Panic when shutting down windowing by close button #387

cybersoulK opened this issue Nov 13, 2023 · 2 comments · Fixed by #394

Comments

@cybersoulK
Copy link

cybersoulK commented Nov 13, 2023

panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', /Users/.../.cargo/registry/src/index.crates.io-6f17d22bba15001f/web-audio-api-0.36.1/src/context/concrete_base.rs:415:40

panicked at 'called `Result::unwrap()` on an `Err` value: "SendError(..)"', /Users/.../.cargo/registry/src/index.crates.io-6f17d22bba15001f/web-audio-api-0.36.1/src/context/concrete_base.rs:415:40

panicked at 'panic in a function that cannot unwind', library/core/src/panicking.rs:126:5
thread caused non-unwinding panic. aborting.

this happens when i shutdown the winit windowing by the close UI button,
but it does not happen when i close the terminal by Ctrl + C

might wanna use?

self.send_control_msg(message).ok();
@orottier
Copy link
Owner

Thanks. We should indeed not use unwrap here.
It's probably best if send_control_msg absorbs all SendErrors and logs a warning and, if not already the case, puts the context in Suspended state.
I probably have time to fix this near the end of the week, but feel free to submit a PR yourself earlier.

@orottier
Copy link
Owner

I have prepared a fix in #394

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 a pull request may close this issue.

2 participants