Skip to content

Commit

Permalink
Merge pull request #2037 from billhollings/fix-debug-msg-deadlock
Browse files Browse the repository at this point in the history
Fix deadlock when reporting debug message on MVKInstance destruction.
  • Loading branch information
billhollings authored Oct 10, 2023
2 parents 568cc3a + 0584aa0 commit ee271b3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions MoltenVK/MoltenVK/GPUObjects/MVKInstance.mm
Original file line number Diff line number Diff line change
Expand Up @@ -723,11 +723,12 @@
_useCreationCallbacks = true;
mvkDestroyContainerContents(_physicalDevices);

lock_guard<mutex> 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<mutex> lock(_dcbLock);
mvkDestroyContainerContents(_debugReportCallbacks);
}

0 comments on commit ee271b3

Please sign in to comment.