layers: Fixed dispatch table teardown issues in ObjectTracker
authorMark Lobodzinski <mark@lunarg.com>
Tue, 26 May 2015 17:16:22 +0000 (12:16 -0500)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 18 Jun 2015 02:56:36 +0000 (20:56 -0600)
Table pointers need to be saved before tables destroyed.

vk-layer-generate.py

index 6f57e49f5d5ffd2adc9acbe8e3737a9b05ca1996..184cf365c05b00054c19acff2ce08fcd90a321ce 100755 (executable)
@@ -1330,6 +1330,7 @@ class ObjectTrackerSubcommand(Subcommand):
             destroy_line += '    destroy_obj(%s);\n' % (proto.params[2].name)
             destroy_line += '    loader_platform_thread_unlock_mutex(&objLock);\n'
         elif 'DestroyDevice' in proto.name:
+            using_line   =  '    VkLayerDispatchTable *pDisp =  *(VkLayerDispatchTable **) device;\n'
             destroy_line =  '    loader_platform_thread_lock_mutex(&objLock);\n'
             destroy_line += '    destroy_obj(device);\n'
             destroy_line += '    // Report any remaining objects\n'
@@ -1347,6 +1348,7 @@ class ObjectTrackerSubcommand(Subcommand):
             destroy_line += '    destroyQueueMemRefLists();\n'
             destroy_line += '    loader_platform_thread_unlock_mutex(&objLock);\n'
         elif 'DestroyInstance' in proto.name:
+            using_line   =  '    VkLayerInstanceDispatchTable *pDisp = *(VkLayerInstanceDispatchTable **) instance;\n'
             destroy_line =  '    loader_platform_thread_lock_mutex(&objLock);\n'
             destroy_line += '    destroy_obj(%s);\n' % (param0_name)
             destroy_line += '    // Report any remaining objects in LL\n'