diff --git a/engine/source/runtime/function/render/interface/vulkan/vulkan_rhi.cpp b/engine/source/runtime/function/render/interface/vulkan/vulkan_rhi.cpp index e684a0f8f..734dbb082 100644 --- a/engine/source/runtime/function/render/interface/vulkan/vulkan_rhi.cpp +++ b/engine/source/runtime/function/render/interface/vulkan/vulkan_rhi.cpp @@ -3030,7 +3030,7 @@ namespace Piccolo command_buffer_allocate_info.commandBufferCount = pAllocateInfo->commandBufferCount; VkCommandBuffer vk_command_buffer; - pCommandBuffers = new RHICommandBuffer(); + pCommandBuffers = new VulkanCommandBuffer(); VkResult result = vkAllocateCommandBuffers(m_device, &command_buffer_allocate_info, &vk_command_buffer); ((VulkanCommandBuffer*)pCommandBuffers)->setResource(vk_command_buffer); diff --git a/engine/source/runtime/function/render/passes/ui_pass.cpp b/engine/source/runtime/function/render/passes/ui_pass.cpp index 0caef5c89..c81bbda53 100644 --- a/engine/source/runtime/function/render/passes/ui_pass.cpp +++ b/engine/source/runtime/function/render/passes/ui_pass.cpp @@ -49,7 +49,7 @@ namespace Piccolo allocInfo.commandPool = m_rhi->getCommandPoor(); allocInfo.commandBufferCount = 1; - RHICommandBuffer* commandBuffer = new VulkanCommandBuffer(); + RHICommandBuffer* commandBuffer = nullptr; if (RHI_SUCCESS != m_rhi->allocateCommandBuffers(&allocInfo, commandBuffer)) { throw std::runtime_error("failed to allocate command buffers!");