- 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

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();
}