From 91958acad2c15f52bda74c58f6c39bd980207d2a Mon Sep 17 00:00:00 2001 From: Sascha Willems Date: Wed, 15 Dec 2021 19:32:47 +0100 Subject: [PATCH] Only destroy ImGui context of != null Fixes #911 --- base/VulkanUIOverlay.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 */