Android: Handle some possible surface loss cases

This commit is contained in:
Connor McLaughlin
2021-06-07 18:13:05 +10:00
parent 141fac0481
commit 20afc1c4a1
3 changed files with 10 additions and 7 deletions

View File

@ -742,7 +742,8 @@ bool SwapChain::ResizeSwapChain(u32 new_width /* = 0 */, u32 new_height /* = 0 *
if (!CreateSwapChain() || !SetupSwapChainImages())
{
Panic("Failed to re-configure swap chain images, this is fatal (for now)");
DestroySwapChainImages();
DestroySwapChain();
return false;
}
@ -755,7 +756,8 @@ bool SwapChain::RecreateSwapChain()
if (!CreateSwapChain() || !SetupSwapChainImages())
{
Panic("Failed to re-configure swap chain images, this is fatal (for now)");
DestroySwapChainImages();
DestroySwapChain();
return false;
}