Qt: Don't detach surface from container when deleting the surface

This commit is contained in:
TheLastRar 2025-11-17 01:26:39 +00:00 committed by lightningterror
parent 9aabb197e6
commit 5476c5a17f

View File

@ -2502,9 +2502,6 @@ void MainWindow::destroyDisplayWidget(bool show_game_list)
if (!isRenderingFullscreen() && !isRenderingToMain())
saveDisplayWindowGeometryToConfig();
// Detatch display surface from container.
m_display_surface->setParent(nullptr);
if (isRenderingToMain())
{
pxAssertRel(m_ui.mainContainer->indexOf(m_display_container) == 1, "Display widget in stack");
@ -2516,17 +2513,12 @@ void MainWindow::destroyDisplayWidget(bool show_game_list)
}
}
if (m_display_surface)
{
m_display_surface->destroy();
m_display_surface = nullptr;
}
if (m_display_container)
{
m_display_container->deleteLater();
m_display_container = nullptr;
}
// displau surface is always in a container
pxAssert(m_display_container != nullptr);
m_display_container->deleteLater();
m_display_container = nullptr;
// m_display_surface will be destroyed by the container's dtor
m_display_surface = nullptr;
updateDisplayRelatedActions(false, false, false);
}