mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-27 08:05:41 +00:00
Qt: Fix crash with Vulkan renderer when unsupported
This commit is contained in:
parent
37c9e69b3e
commit
bccecdbf18
|
@ -129,7 +129,6 @@ QtDisplayWidget* MainWindow::createDisplay(QThread* worker_thread, const QString
|
||||||
{
|
{
|
||||||
reportError(QStringLiteral("Failed to get window info from widget"));
|
reportError(QStringLiteral("Failed to get window info from widget"));
|
||||||
destroyDisplayWidget();
|
destroyDisplayWidget();
|
||||||
delete m_host_display;
|
|
||||||
m_host_display = nullptr;
|
m_host_display = nullptr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +137,6 @@ QtDisplayWidget* MainWindow::createDisplay(QThread* worker_thread, const QString
|
||||||
{
|
{
|
||||||
reportError(tr("Failed to create host display device context."));
|
reportError(tr("Failed to create host display device context."));
|
||||||
destroyDisplayWidget();
|
destroyDisplayWidget();
|
||||||
delete m_host_display;
|
|
||||||
m_host_display = nullptr;
|
m_host_display = nullptr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -245,6 +243,9 @@ void MainWindow::displaySizeRequested(qint32 width, qint32 height)
|
||||||
|
|
||||||
void MainWindow::destroyDisplay()
|
void MainWindow::destroyDisplay()
|
||||||
{
|
{
|
||||||
|
if (!m_host_display)
|
||||||
|
return;
|
||||||
|
|
||||||
DebugAssert(m_host_display && m_display_widget);
|
DebugAssert(m_host_display && m_display_widget);
|
||||||
m_host_display = nullptr;
|
m_host_display = nullptr;
|
||||||
destroyDisplayWidget();
|
destroyDisplayWidget();
|
||||||
|
|
|
@ -486,7 +486,7 @@ bool QtHostInterface::AcquireHostDisplay()
|
||||||
if (!display_widget || !m_display->HasRenderDevice())
|
if (!display_widget || !m_display->HasRenderDevice())
|
||||||
{
|
{
|
||||||
emit destroyDisplayRequested();
|
emit destroyDisplayRequested();
|
||||||
m_display = nullptr;
|
m_display.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue