Fix memory leaks
This commit is contained in:
parent
322309061d
commit
e93f375ca6
1 changed files with 4 additions and 0 deletions
|
@ -66,12 +66,16 @@ RenderTarget* Renderer::createSurfaceRenderTarget(VkSurfaceKHR surface) {
|
|||
|
||||
vkCreateSwapchainKHR(device_, &swapchainCreateInfo, nullptr, &target->swapchain);
|
||||
|
||||
delete[] surfaceFormats;
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
void Renderer::destroyRenderTarget(RenderTarget* target) {
|
||||
vkDestroySwapchainKHR(device_, target->swapchain, nullptr);
|
||||
vkDestroySurfaceKHR(instance_, target->surface, nullptr);
|
||||
|
||||
delete target;
|
||||
}
|
||||
|
||||
void Renderer::createInstance() {
|
||||
|
|
Reference in a new issue