Permalink
Browse files

Minor error checking improvement

  • Loading branch information...
hrydgard committed Nov 26, 2017
1 parent a763fe4 commit 234f30a3721eece4c5e33af11f6f3da8761866e3
Showing with 2 additions and 0 deletions.
  1. +2 −0 android/jni/app-android.cpp
@@ -301,6 +301,7 @@ bool AndroidVulkanContext::Init(ANativeWindow *wnd, int desiredBackbufferSizeX,
int physicalDevice = g_Vulkan->GetBestPhysicalDevice();
if (physicalDevice < 0) {
ELOG("No usable Vulkan device found.");
g_Vulkan->DestroyInstance();
delete g_Vulkan;
g_Vulkan = nullptr;
return false;
@@ -313,6 +314,7 @@ bool AndroidVulkanContext::Init(ANativeWindow *wnd, int desiredBackbufferSizeX,
if (g_Vulkan->CreateDevice() != VK_SUCCESS) {
ILOG("Failed to create vulkan device: %s", g_Vulkan->InitError().c_str());
System_SendMessage("toast", "No Vulkan driver found. Using OpenGL instead.");
g_Vulkan->DestroyInstance();
delete g_Vulkan;
g_Vulkan = nullptr;
return false;

0 comments on commit 234f30a

Please sign in to comment.