Index: src/gpu/vk/GrVkBackendContext.cpp |
diff --git a/src/gpu/vk/GrVkBackendContext.cpp b/src/gpu/vk/GrVkBackendContext.cpp |
index 0358618cd2c851dae4f3800e52c507dbd22c26de..9506da554648bbbe064a60ad81b032840f42a20a 100644 |
--- a/src/gpu/vk/GrVkBackendContext.cpp |
+++ b/src/gpu/vk/GrVkBackendContext.cpp |
@@ -116,6 +116,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() { |
err = vkEnumeratePhysicalDevices(inst, &gpuCount, nullptr); |
if (err) { |
SkDebugf("vkEnumeratePhysicalDevices failed: %d\n", err); |
+ vkDestroyInstance(inst, nullptr); |
SkFAIL("failing"); |
} |
SkASSERT(gpuCount > 0); |
@@ -125,6 +126,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() { |
err = vkEnumeratePhysicalDevices(inst, &gpuCount, &physDev); |
if (err) { |
SkDebugf("vkEnumeratePhysicalDevices failed: %d\n", err); |
+ vkDestroyInstance(inst, nullptr); |
SkFAIL("failing"); |
} |
@@ -214,6 +216,7 @@ const GrVkBackendContext* GrVkBackendContext::Create() { |
err = vkCreateDevice(physDev, &deviceInfo, nullptr, &device); |
if (err) { |
SkDebugf("CreateDevice failed: %d\n", err); |
+ vkDestroyInstance(inst, nullptr); |
return nullptr; |
} |