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

Cast ptr to Device not Surface #5640

Merged
merged 1 commit into from
Apr 30, 2024
Merged

Cast ptr to Device not Surface #5640

merged 1 commit into from
Apr 30, 2024

Conversation

sagudev
Copy link
Contributor

@sagudev sagudev commented Apr 30, 2024

Arc has device stored inside not surface.

fixes #5637

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.

Arc has device stored inside not surface.

fixes gfx-rs#5637
@sagudev sagudev requested a review from a team as a code owner April 30, 2024 15:08
@cwfitzgerald cwfitzgerald added the PR: needs back-porting PR with a fix that needs to land on crates label Apr 30, 2024
Copy link
Member

@cwfitzgerald cwfitzgerald left a 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

@cwfitzgerald cwfitzgerald merged commit 5fa537b into gfx-rs:trunk Apr 30, 2024
25 checks passed
Copy link
Member

@ErichDonGubler ErichDonGubler left a 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>());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a copy-paste error introduced in #5081 (CC @udoprog, the author, as an FYI, no action items I can see).

vorporeal pushed a commit to warpdotdev/wgpu that referenced this pull request May 9, 2024
Wumpf pushed a commit to Wumpf/wgpu that referenced this pull request May 18, 2024
@Wumpf Wumpf mentioned this pull request May 18, 2024
6 tasks
ErichDonGubler pushed a commit that referenced this pull request May 18, 2024
@Wumpf
Copy link
Member

Wumpf commented Jul 26, 2024

this fix here has a little whoopsie in there, fixed here:

(noticed only now after merging that these are related)

@sagudev
Copy link
Contributor Author

sagudev commented Jul 26, 2024

Unsafe code is hard 😔.

morr0ne pushed a commit to verdiwm/wgpu that referenced this pull request Jul 28, 2024
@cwfitzgerald cwfitzgerald removed the PR: needs back-porting PR with a fix that needs to land on crates label Jul 31, 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.

STATUS_ACCESS_VIOLATION on exit
4 participants