Fix crash if pl_vulkan_create() fails

This commit is contained in:
Cameron Gutman 2023-12-13 01:04:54 -06:00
parent 333d97160e
commit 3ddc8ad68a

View file

@ -96,6 +96,7 @@ PlVkRenderer::PlVkRenderer(IFFmpegRenderer* backendRenderer) :
PlVkRenderer::~PlVkRenderer()
{
if (m_Vulkan != nullptr) {
for (int i = 0; i < (int)SDL_arraysize(m_Overlays); i++) {
if (m_Overlays[i].hasOverlay) {
pl_tex_destroy(m_Vulkan->gpu, &m_Overlays[i].overlay.tex);
@ -108,6 +109,7 @@ PlVkRenderer::~PlVkRenderer()
for (int i = 0; i < (int)SDL_arraysize(m_Textures); i++) {
pl_tex_destroy(m_Vulkan->gpu, &m_Textures[i]);
}
}
pl_renderer_destroy(&m_Renderer);
pl_swapchain_destroy(&m_Swapchain);