Merge "Poll fences before they are destroyed" into main
diff --git a/host/vulkan/VkDecoderGlobalState.cpp b/host/vulkan/VkDecoderGlobalState.cpp
index 013acb4..4ed1bdd 100644
--- a/host/vulkan/VkDecoderGlobalState.cpp
+++ b/host/vulkan/VkDecoderGlobalState.cpp
@@ -2012,6 +2012,9 @@
             destroyFenceLocked(device, deviceDispatch, fence, nullptr, false);
         }
 
+        // Should happen before destroying fences
+        deviceInfo->deviceOpTracker->OnDestroyDevice();
+
         // Destroy pooled external fences
         auto deviceFences = deviceInfo->externalFencePool->popAll();
         for (auto fence : deviceFences) {
@@ -2019,8 +2022,6 @@
             mFenceInfo.erase(fence);
         }
 
-        deviceInfo->deviceOpTracker->OnDestroyDevice();
-
         // Run the underlying API call.
         m_vk->vkDestroyDevice(device, pAllocator);