- fix shutdown crash due to GetVulkanFrameBuffer returning null when VulkanFrameBuffer is destroyed

This commit is contained in:
Magnus Norddahl 2019-04-30 20:02:00 +02:00
parent ab8378152f
commit 23d0cce395
1 changed files with 6 additions and 1 deletions

View File

@ -93,9 +93,12 @@ VulkanFrameBuffer::VulkanFrameBuffer(void *hMonitor, bool fullscreen, VulkanDevi
VulkanFrameBuffer::~VulkanFrameBuffer()
{
// screen is already null at this point, but VkHardwareTexture::ResetAll needs it during clean up. Is there a better way we can do this?
auto tmp = screen;
screen = this;
// All descriptors must be destroyed before the descriptor pool in renderpass manager is destroyed
VkHardwareTexture::ResetAll();
VKBuffer::ResetAll();
PPResource::ResetAll();
@ -107,6 +110,8 @@ VulkanFrameBuffer::~VulkanFrameBuffer()
delete mLights;
mShadowMap.Reset();
screen = tmp;
DeleteFrameObjects();
}