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

[d3d12] Avoid panic on instance drop #5134

Merged
merged 3 commits into from
Jan 24, 2024
Merged

[d3d12] Avoid panic on instance drop #5134

merged 3 commits into from
Jan 24, 2024

Conversation

hakolao
Copy link
Contributor

@hakolao hakolao commented Jan 24, 2024

Connections
Attempts to fix #4604

Description
register_exception_handler is only called when InstanceFlags::VALIDATION are present. Thus unregister should also be only called then.

    if instance_flags.contains(wgt::InstanceFlags::VALIDATION) {
        //...
        super::exception::register_exception_handler();
    }

Testing
Tested on one of my sample projects...

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@hakolao hakolao requested a review from a team as a code owner January 24, 2024 10:46
@nical
Copy link
Contributor

nical commented Jan 24, 2024

Nice!

@nical
Copy link
Contributor

nical commented Jan 24, 2024

Looks like you need to remove that bitflags::Flags import.

@teoxoy teoxoy changed the title Fix 4604 [d3d12] Avoid panic on instance drop Jan 24, 2024
@teoxoy teoxoy merged commit b3490de into gfx-rs:trunk Jan 24, 2024
27 checks passed
@cwfitzgerald cwfitzgerald added the PR: needs back-porting PR with a fix that needs to land on crates label Jan 27, 2024
cwfitzgerald pushed a commit to cwfitzgerald/wgpu that referenced this pull request Feb 29, 2024
@cwfitzgerald cwfitzgerald removed the PR: needs back-porting PR with a fix that needs to land on crates label Mar 1, 2024
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.

panic! when Instance is destroyed
4 participants