From 0615ba3e545932242fd3bc4cce3608b079f910ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 29 Jan 2024 00:04:13 +0100 Subject: [PATCH] Some paranoia and a comment --- GPU/GPUCommonHW.cpp | 6 ++++-- UI/NativeApp.cpp | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) 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();