File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -404,6 +404,9 @@ impl crate::Device for super::Device {
404404 unsafe fn destroy_buffer ( & self , mut buffer : super :: Buffer ) {
405405 // Only happens when it's using the windows_rs feature and there's an allocation
406406 if let Some ( alloc) = buffer. allocation . take ( ) {
407+ // Resource should be dropped before free suballocation
408+ drop ( buffer) ;
409+
407410 super :: suballocation:: free_buffer_allocation (
408411 self ,
409412 alloc,
@@ -494,6 +497,9 @@ impl crate::Device for super::Device {
494497
495498 unsafe fn destroy_texture ( & self , mut texture : super :: Texture ) {
496499 if let Some ( alloc) = texture. allocation . take ( ) {
500+ // Resource should be dropped before free suballocation
501+ drop ( texture) ;
502+
497503 super :: suballocation:: free_texture_allocation (
498504 self ,
499505 alloc,
You can’t perform that action at this time.
0 commit comments