-
Notifications
You must be signed in to change notification settings - Fork 937
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
Cast ptr to Device not Surface #5640
Conversation
Arc has device stored inside not surface. fixes gfx-rs#5637
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that's a doozy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, seems pretty clear!
@@ -34,7 +34,7 @@ impl AnyDevice { | |||
unsafe fn drop_glue<A: HalApi>(ptr: *mut ()) { | |||
// Drop the arc this instance is holding. | |||
unsafe { | |||
_ = Arc::from_raw(ptr.cast::<A::Surface>()); | |||
_ = Arc::from_raw(ptr.cast::<A::Device>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fix here has a little whoopsie in there, fixed here: (noticed only now after merging that these are related) |
Unsafe code is hard 😔. |
Arc has device stored inside not surface.
fixes #5637
Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.