layers: Fix bug where logging_callback was not being correctly cleaned up
authorTobin Ehlis <tobin@lunarg.com>
Mon, 21 Sep 2015 15:36:47 +0000 (09:36 -0600)
committerTobin Ehlis <tobin@lunarg.com>
Mon, 21 Sep 2015 15:43:16 +0000 (09:43 -0600)
layers/vk_layer_logging.h

index f65f488723fe77efea62e75b90e334ea2a79af59..bef168ccef7b70e299e47fb26a1e90587749cce2 100644 (file)
@@ -157,6 +157,9 @@ static inline VkResult layer_create_msg_callback(
     if (!pNewDbgFuncNode)
         return VK_ERROR_OUT_OF_HOST_MEMORY;
 
+    // Handle of 0 is logging_callback so use allocated Node address as unique handle
+    if (!(*pMsgCallback))
+        *pMsgCallback = (uint64_t) pNewDbgFuncNode;
     pNewDbgFuncNode->msgCallback = *pMsgCallback;
     pNewDbgFuncNode->pfnMsgCallback = pfnMsgCallback;
     pNewDbgFuncNode->msgFlags = msgFlags;