mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-09 09:48:43 +00:00
Fix crash if pl_vulkan_create() fails
This commit is contained in:
parent
333d97160e
commit
3ddc8ad68a
1 changed files with 11 additions and 9 deletions
|
@ -96,17 +96,19 @@ PlVkRenderer::PlVkRenderer(IFFmpegRenderer* backendRenderer) :
|
||||||
|
|
||||||
PlVkRenderer::~PlVkRenderer()
|
PlVkRenderer::~PlVkRenderer()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < (int)SDL_arraysize(m_Overlays); i++) {
|
if (m_Vulkan != nullptr) {
|
||||||
if (m_Overlays[i].hasOverlay) {
|
for (int i = 0; i < (int)SDL_arraysize(m_Overlays); i++) {
|
||||||
pl_tex_destroy(m_Vulkan->gpu, &m_Overlays[i].overlay.tex);
|
if (m_Overlays[i].hasOverlay) {
|
||||||
|
pl_tex_destroy(m_Vulkan->gpu, &m_Overlays[i].overlay.tex);
|
||||||
|
}
|
||||||
|
if (m_Overlays[i].hasStagingOverlay) {
|
||||||
|
pl_tex_destroy(m_Vulkan->gpu, &m_Overlays[i].stagingOverlay.tex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (m_Overlays[i].hasStagingOverlay) {
|
|
||||||
pl_tex_destroy(m_Vulkan->gpu, &m_Overlays[i].stagingOverlay.tex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)SDL_arraysize(m_Textures); i++) {
|
for (int i = 0; i < (int)SDL_arraysize(m_Textures); i++) {
|
||||||
pl_tex_destroy(m_Vulkan->gpu, &m_Textures[i]);
|
pl_tex_destroy(m_Vulkan->gpu, &m_Textures[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pl_renderer_destroy(&m_Renderer);
|
pl_renderer_destroy(&m_Renderer);
|
||||||
|
|
Loading…
Reference in a new issue