wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Clean up weak references to texture views and bind groups

Open xiaopengli89 opened this issue 1 year ago • 2 comments

Description

Cleanup weak references to texture views and bind groups to prevent leak.

image

Checklist

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

xiaopengli89 avatar Apr 24 '24 07:04 xiaopengli89

Tagging jimb on this as he's most aware of the lifetime management in wgpu-core

cwfitzgerald avatar Apr 24 '24 16:04 cwfitzgerald

@xiaopengli89 I've pushed a commit that makes the change I suggested. Could you look it over and see if it seems okay, and verify that it does fix the leak?

jimblandy avatar May 01 '24 19:05 jimblandy

@xiaopengli89 I've pushed a commit that makes the change I suggested. Could you look it over and see if it seems okay, and verify that it does fix the leak?

@jimblandy LGTM.

xiaopengli89 avatar May 06 '24 03:05 xiaopengli89

@jimblandy Sorry, we cannot use the change because suspected_resources only contains resources whose user handle has died.

xiaopengli89 avatar May 07 '24 07:05 xiaopengli89