Merge pull request #907 from rajnesh-kanwal/fix_memory_leak

Fixes memory leak due to ImGui context not being destroyed.
This commit is contained in:
Sascha Willems 2021-12-11 11:00:13 +01:00 committed by GitHub
commit 48de215d0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,7 +50,9 @@ namespace vks
io.FontGlobalScale = scale;
}
UIOverlay::~UIOverlay() { }
UIOverlay::~UIOverlay() {
ImGui::DestroyContext();
}
/** Prepare all vulkan resources required to render the UI overlay */
void UIOverlay::prepareResources()
@ -397,7 +399,6 @@ namespace vks
void UIOverlay::freeResources()
{
ImGui::DestroyContext();
vertexBuffer.destroy();
indexBuffer.destroy();
vkDestroyImageView(device->logicalDevice, fontView, nullptr);