Qt: Fix loading a new game crashing on Wayland (fixes #1992)

This commit is contained in:
Vicki Pfau 2020-12-20 21:00:17 -08:00
parent ff6218fe1e
commit cadceecdab
2 changed files with 10 additions and 9 deletions

View File

@ -82,6 +82,7 @@ Other fixes:
- Qt: Fix crash when editing shortcuts with none selected (fixes mgba.io/i/1964)
- Qt: Fix crashing when no OpenGL context can be obtained
- Qt: Fix issues with I/O viewer not properly synchronizing state
- Qt: Fix loading a new game crashing on Wayland (fixes mgba.io/i/1992)
- SM83: Simplify register pair access on big endian
- SM83: Disassemble STOP as one byte
- Wii: Fix crash on unloading irregularly sized GBA ROMs

View File

@ -808,15 +808,6 @@ void Window::gameStopped() {
action->setEnabled(false);
}
setWindowFilePath(QString());
detachWidget(m_display.get());
setLogo();
if (m_display) {
#ifdef M_CORE_GB
m_display->setMinimumSize(GB_VIDEO_HORIZONTAL_PIXELS, GB_VIDEO_VERTICAL_PIXELS);
#elif defined(M_CORE_GBA)
m_display->setMinimumSize(GBA_VIDEO_HORIZONTAL_PIXELS, GBA_VIDEO_VERTICAL_PIXELS);
#endif
}
m_actions.clearMenu("videoLayers");
m_actions.clearMenu("audioChannels");
@ -829,6 +820,15 @@ void Window::gameStopped() {
m_audioProcessor.reset();
}
m_display->stopDrawing();
detachWidget(m_display.get());
setLogo();
if (m_display) {
#ifdef M_CORE_GB
m_display->setMinimumSize(GB_VIDEO_HORIZONTAL_PIXELS, GB_VIDEO_VERTICAL_PIXELS);
#elif defined(M_CORE_GBA)
m_display->setMinimumSize(GBA_VIDEO_HORIZONTAL_PIXELS, GBA_VIDEO_VERTICAL_PIXELS);
#endif
}
m_controller.reset();
updateTitle();