Skip to content

Commit cfd431e

Browse files
layers: Fix WriteLockGuards on atexit
1 parent 4db6c09 commit cfd431e

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

layers/chassis/dispatch_object_manual.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -608,15 +608,13 @@ void FreeData(void *key, VkDevice device) {
608608
}
609609

610610
void FreeAllData() {
611-
{
612-
last_used_device.store(nullptr);
613-
WriteLockGuard lock(device_mutex);
614-
device_data.clear();
615-
}
616-
{
617-
WriteLockGuard lock(instance_mutex);
618-
instance_data.clear();
619-
}
611+
// We use to have a WriteLockGuard here, but ran into threading issues.
612+
// This function is solely called from the atexit() handler, there shouldn't be anything vulkan related going on any more in any
613+
// application threads. See https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/10659
614+
last_used_device.store(nullptr);
615+
device_data.clear();
616+
617+
instance_data.clear();
620618
}
621619

622620
HandleWrapper::HandleWrapper(DebugReport *dr) : Logger(dr) {}

0 commit comments

Comments
 (0)