mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 00:03:29 +00:00
[d3d12] Drop resource before free suballocation (#5943)
This commit is contained in:
parent
750f72af8d
commit
349f182966
@ -404,6 +404,9 @@ impl crate::Device for super::Device {
|
||||
unsafe fn destroy_buffer(&self, mut buffer: super::Buffer) {
|
||||
// Only happens when it's using the windows_rs feature and there's an allocation
|
||||
if let Some(alloc) = buffer.allocation.take() {
|
||||
// Resource should be dropped before free suballocation
|
||||
drop(buffer);
|
||||
|
||||
super::suballocation::free_buffer_allocation(
|
||||
self,
|
||||
alloc,
|
||||
@ -494,6 +497,9 @@ impl crate::Device for super::Device {
|
||||
|
||||
unsafe fn destroy_texture(&self, mut texture: super::Texture) {
|
||||
if let Some(alloc) = texture.allocation.take() {
|
||||
// Resource should be dropped before free suballocation
|
||||
drop(texture);
|
||||
|
||||
super::suballocation::free_texture_allocation(
|
||||
self,
|
||||
alloc,
|
||||
|
Loading…
Reference in New Issue
Block a user