Properly dispose of DescriptorAllocator

This commit is contained in:
Dzmitry Malyshau
2019-10-29 15:45:48 -04:00
parent ff1adb34d9
commit 384de9ca52
2 changed files with 4 additions and 3 deletions

View File

@@ -775,10 +775,11 @@ impl<B: hal::Backend> Device<B> {
}
}
pub(crate) fn destroy_self(self) {
pub(crate) fn dispose(self) {
self.com_allocator.destroy(&self.raw);
let desc_alloc = self.desc_allocator.into_inner();
unsafe {
self.desc_allocator.lock().cleanup(&self.raw);
desc_alloc.dispose(&self.raw);
}
}
}

View File

@@ -445,7 +445,7 @@ impl<B: hal::Backend> Drop for Hub<B> {
// self.adapters
for (_, (device, _)) in devices.map.drain() {
device.destroy_self();
device.dispose();
}
}
}