Only destroy ImGui context of != null

Fixes #911
This commit is contained in:
Sascha Willems 2021-12-15 19:32:47 +01:00
parent 48de215d0b
commit 91958acad2

View file

@ -51,8 +51,10 @@ namespace vks
} }
UIOverlay::~UIOverlay() { UIOverlay::~UIOverlay() {
if (ImGui::GetCurrentContext()) {
ImGui::DestroyContext(); ImGui::DestroyContext();
} }
}
/** Prepare all vulkan resources required to render the UI overlay */ /** Prepare all vulkan resources required to render the UI overlay */
void UIOverlay::prepareResources() void UIOverlay::prepareResources()