metal: add the missing msg_send![view, retain] call within from_view (#2976)

* metal: add the missing `msg_send![view, retain]` call within `from_view`

* Update CHANGELOG
This commit is contained in:
Jinlei Li 2022-08-20 22:14:57 +08:00 committed by GitHub
parent c6ca2a7d0d
commit a08ea2a255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -68,6 +68,9 @@ the same every time it is rendered, we now warn if it is missing.
- Fix compilation errors when using wgpu-core in isolation while targetting `wasm32-unknown-unknown` by @Seamooo in [#2922](https://github.com/gfx-rs/wgpu/pull/2922)
- Fixed opening of RenderDoc library by @abuffseagull in [#2930](https://github.com/gfx-rs/wgpu/pull/2930)
#### Metal
- Add the missing `msg_send![view, retain]` call within `from_view` by @jinleili in [#2976](https://github.com/gfx-rs/wgpu/pull/2976)
### Changes
#### General

View File

@ -86,6 +86,7 @@ impl super::Surface {
let render_layer =
mem::transmute::<_, &mtl::MetalLayerRef>(Self::get_metal_layer(view, delegate))
.to_owned();
let _: *mut c_void = msg_send![view, retain];
Self::new(NonNull::new(view), render_layer)
}