loader: Fix issue when ICD DestroyDebugReportCallbackEXT not found.
authorMark Young <marky@lunarg.com>
Wed, 4 May 2016 22:44:10 +0000 (16:44 -0600)
committerMark Young <marky@lunarg.com>
Thu, 5 May 2016 16:01:53 +0000 (10:01 -0600)
Change-Id: Ic1d0f67ec2f8ca438c4bd546e6beb4d565daf89a

loader/debug_report.c

index ae9b3dd..c339c70 100644 (file)
@@ -305,6 +305,10 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateDebugReportCallback(
     if (icd) {
         storage_idx = 0;
         for (icd = inst->icds; icd; icd = icd->next) {
+            if (NULL == icd->DestroyDebugReportCallbackEXT) {
+                continue;
+            }
+
             if (icd_info[storage_idx]) {
                 icd->DestroyDebugReportCallbackEXT(
                     icd->instance, icd_info[storage_idx], pAllocator);
@@ -336,6 +340,10 @@ terminator_DestroyDebugReportCallback(VkInstance instance,
     icd_info = *(VkDebugReportCallbackEXT **)&callback;
     storage_idx = 0;
     for (icd = inst->icds; icd; icd = icd->next) {
+        if (NULL == icd->DestroyDebugReportCallbackEXT) {
+            continue;
+        }
+
         if (icd_info[storage_idx]) {
             icd->DestroyDebugReportCallbackEXT(
                 icd->instance, icd_info[storage_idx], pAllocator);