diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm index e3c94135a..6e768161d 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm @@ -723,11 +723,12 @@ _useCreationCallbacks = true; mvkDestroyContainerContents(_physicalDevices); - lock_guard lock(_dcbLock); - mvkDestroyContainerContents(_debugReportCallbacks); - - MVKLogInfo("Destroyed VkInstance for Vulkan version %s with %d Vulkan extensions enabled.", + // Since this message may invoke debug callbacks, do it before locking callbacks. + MVKLogInfo("Destroying VkInstance for Vulkan version %s with %d Vulkan extensions enabled.", mvkGetVulkanVersionString(_appInfo.apiVersion).c_str(), _enabledExtensions.getEnabledCount()); + + lock_guard lock(_dcbLock); + mvkDestroyContainerContents(_debugReportCallbacks); }