mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-11 18:50:58 +02:00
FIFOPlayerWindow: Trigger destructor on Dolphin shutdown
Make MainWindow::m_fifo_window a unique_ptr to ensure its destructor is triggered when MainWindow is destroyed. FIFOPlayerWindow doesn't set MainWindow as its parent in order to prevent raising MainWindow when focusing FIFOPlayerWindow. This avoids MainWindow covering up RenderWidget when, e.g., trying to use the object range feature to pinpoint the index of a particular object. As a consequence, unlike most QObjects FIFOPlayerWindow wasn't destroyed when its parent widget was since it didn't have one.
This commit is contained in:
@@ -1379,8 +1379,8 @@ void MainWindow::ShowFIFOPlayer()
|
||||
{
|
||||
if (!m_fifo_window)
|
||||
{
|
||||
m_fifo_window = new FIFOPlayerWindow(m_system.GetFifoPlayer(), m_system.GetFifoRecorder());
|
||||
connect(m_fifo_window, &FIFOPlayerWindow::LoadFIFORequested, this,
|
||||
m_fifo_window.reset(new FIFOPlayerWindow(m_system.GetFifoPlayer(), m_system.GetFifoRecorder()));
|
||||
connect(m_fifo_window.get(), &FIFOPlayerWindow::LoadFIFORequested, this,
|
||||
[this](const QString& path) { StartGame(path, ScanForSecondDisc::No); });
|
||||
}
|
||||
|
||||
|
@@ -16,6 +16,7 @@
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
||||
#include "Core/Boot/Boot.h"
|
||||
#include "DolphinQt/FIFO/FIFOPlayerWindow.h"
|
||||
|
||||
class QMenu;
|
||||
class QStackedWidget;
|
||||
@@ -29,7 +30,6 @@ class CheatsManager;
|
||||
class CodeWidget;
|
||||
class DiscordHandler;
|
||||
class DragEnterEvent;
|
||||
class FIFOPlayerWindow;
|
||||
class FreeLookWindow;
|
||||
class GameList;
|
||||
class GBATASInputWindow;
|
||||
@@ -245,7 +245,9 @@ private:
|
||||
std::unique_ptr<BootParameters> m_pending_boot;
|
||||
|
||||
SettingsWindow* m_settings_window = nullptr;
|
||||
FIFOPlayerWindow* m_fifo_window = nullptr;
|
||||
// m_fifo_window doesn't set MainWindow as its parent so that the fifo can be focused without
|
||||
// raising the main window, so use a unique_ptr to make sure it gets destroyed.
|
||||
std::unique_ptr<FIFOPlayerWindow> m_fifo_window = nullptr;
|
||||
SkylanderPortalWindow* m_skylander_window = nullptr;
|
||||
InfinityBaseWindow* m_infinity_window = nullptr;
|
||||
WiiSpeakWindow* m_wii_speak_window = nullptr;
|
||||
|
Reference in New Issue
Block a user