mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
Qt: Fix possible crash/race when startup fails
This commit is contained in:
parent
59cf799491
commit
6d945439eb
|
@ -227,7 +227,9 @@ void QtHostInterface::doHandleKeyEvent(int key, bool pressed)
|
||||||
|
|
||||||
void QtHostInterface::onDisplayWindowResized(int width, int height)
|
void QtHostInterface::onDisplayWindowResized(int width, int height)
|
||||||
{
|
{
|
||||||
m_display_window->onWindowResized(width, height);
|
// this can be null if it was destroyed and the main thread is late catching up
|
||||||
|
if (m_display_window)
|
||||||
|
m_display_window->onWindowResized(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QtHostInterface::AcquireHostDisplay()
|
bool QtHostInterface::AcquireHostDisplay()
|
||||||
|
@ -258,7 +260,6 @@ void QtHostInterface::ReleaseHostDisplay()
|
||||||
{
|
{
|
||||||
DebugAssert(m_display_window && m_display == m_display_window->getHostDisplayInterface());
|
DebugAssert(m_display_window && m_display == m_display_window->getHostDisplayInterface());
|
||||||
m_display = nullptr;
|
m_display = nullptr;
|
||||||
m_display_window->disconnect(this);
|
|
||||||
m_display_window->destroyDeviceContext();
|
m_display_window->destroyDeviceContext();
|
||||||
m_display_window = nullptr;
|
m_display_window = nullptr;
|
||||||
emit destroyDisplayWindowRequested();
|
emit destroyDisplayWindowRequested();
|
||||||
|
|
Loading…
Reference in a new issue