diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index a3c1a8a02d..a40be84fd4 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -397,8 +397,10 @@ GPUCommonHW::~GPUCommonHW() { framebufferManager_->DestroyAllFBOs(); delete framebufferManager_; delete textureCache_; - shaderManager_->ClearShaders(); - delete shaderManager_; + if (shaderManager_) { + shaderManager_->ClearShaders(); + delete shaderManager_; + } } // Called once per frame. Might also get called during the pause screen diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 49ed7cd003..38e1e60b7d 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -924,6 +924,7 @@ void NativeShutdownGraphics() { } g_iconCache.ClearTextures(); + // TODO: This is not really necessary with Vulkan on Android - could keep shaders etc in memory if (gpu) gpu->DeviceLost();