layers: Erase proper key in draw state.
authorJeremy Hayes <jeremy@lunarg.com>
Fri, 19 Jun 2015 17:37:38 +0000 (11:37 -0600)
committerJeremy Hayes <jeremy@lunarg.com>
Fri, 19 Jun 2015 17:37:38 +0000 (11:37 -0600)
layers/draw_state.cpp

index c4bbd6b602419fe3f969b5ff6de411146ca95373..b3c79745da6c9bc6359976467a4a3771d30b8907 100644 (file)
@@ -1644,10 +1644,11 @@ VK_LAYER_EXPORT VkResult VKAPI vkDestroyDevice(VkDevice device)
     deleteLayouts();
     loader_platform_thread_unlock_mutex(&globalLock);
 
+    dispatch_key key = get_dispatch_key(device);
     VkLayerDispatchTable *pDisp =  get_dispatch_table(draw_state_device_table_map, device);
     VkResult result = pDisp->DestroyDevice(device);
     deviceExtMap.erase(pDisp);
-    draw_state_device_table_map.erase(pDisp);
+    draw_state_device_table_map.erase(key);
     tableDebugMarkerMap.erase(pDisp);
     return result;
 }