diff --git a/base/VulkanUIOverlay.cpp b/base/VulkanUIOverlay.cpp index 3b31d14b..60c9226c 100644 --- a/base/VulkanUIOverlay.cpp +++ b/base/VulkanUIOverlay.cpp @@ -51,7 +51,9 @@ namespace vks } UIOverlay::~UIOverlay() { - ImGui::DestroyContext(); + if (ImGui::GetCurrentContext()) { + ImGui::DestroyContext(); + } } /** Prepare all vulkan resources required to render the UI overlay */