Release baked commands when destroying command buffer

This commit is contained in:
baldurk
2015-09-19 16:43:39 +02:00
parent c1eecb28f0
commit 9aacd2ed5b
+9 -1
View File
@@ -1120,7 +1120,15 @@ VkResult WrappedVulkan::vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer obj)
{
WrappedVkDispRes *wrapped = (WrappedVkDispRes *)GetWrapped(obj);
GetResourceManager()->MarkCleanResource(wrapped->id);
if(wrapped->record) wrapped->record->Delete(GetResourceManager());
if(wrapped->record)
{
if(wrapped->record->bakedCommands)
{
wrapped->record->bakedCommands->Delete(GetResourceManager());
wrapped->record->bakedCommands = NULL;
}
wrapped->record->Delete(GetResourceManager());
}
return ObjDisp(device)->DestroyCommandBuffer(Unwrap(device), wrapped->real.As<VkCmdBuffer>());
}