Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: src/gpu/vk/GrVkBackendContext.cpp

Issue 1867883002: Fix a bunch of memory issues in Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@vkValgrind
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/vk/GrVkExtensions.cpp » ('j') | src/gpu/vk/GrVkGpu.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | src/gpu/vk/GrVkExtensions.cpp » ('j') | src/gpu/vk/GrVkGpu.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698