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

Properly handle user callbacks in surface_configure #4227

Merged
merged 2 commits into from
Oct 11, 2023

Conversation

nical
Copy link
Contributor

@nical nical commented Oct 10, 2023

Checklist

  • Run cargo clippy.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections

I did a sloppy job of fixing this in #4220.
Fixes #4214.

Description

Fix the fix. The initial patch was handling user callbacks only in some cases, missing that there was a return None; at the end of the block. This nests most of the loop into an additional block to reduce the scope of the locks while still handling the user callbacks in the loop as the portion outside of the loop is only taken when an error occurs.

@nical nical requested a review from a team as a code owner October 10, 2023 13:15
@dhardy
Copy link
Contributor

dhardy commented Oct 10, 2023

Works for me 👍

@nical nical merged commit b3135b9 into gfx-rs:trunk Oct 11, 2023
23 checks passed
@nical nical deleted the map-leak2 branch October 11, 2023 07:35
bonsairobo pushed a commit to ForesightMiningSoftwareCorporation/wgpu that referenced this pull request Mar 1, 2024
* Properly handle user callbacks in surface_configure

* Add a changelog entry
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.

Surface::configure can panic with "map callback was leaked"
2 participants