mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Move LogWindow/LogConfigWindow destructor logic -> OnClose
Fixes the issue on macOS where quitting Dolphin from the Dock causes a crash report (https://bugs.dolphin-emu.org/issues/9794). I'm not exactly sure why this works, but it feels right and it turns out to fix the problem.
This commit is contained in:
@ -149,18 +149,20 @@ void CLogWindow::CreateGUIControls()
|
||||
m_cmdline->SetFocus();
|
||||
}
|
||||
|
||||
CLogWindow::~CLogWindow()
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
m_LogManager->RemoveListener((LogTypes::LOG_TYPE)i, LogListener::LOG_WINDOW_LISTENER);
|
||||
}
|
||||
}
|
||||
|
||||
void CLogWindow::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
SaveSettings();
|
||||
event.Skip();
|
||||
RemoveAllListeners();
|
||||
}
|
||||
|
||||
void CLogWindow::RemoveAllListeners()
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
m_LogManager->RemoveListener(static_cast<LogTypes::LOG_TYPE>(i),
|
||||
LogListener::LOG_WINDOW_LISTENER);
|
||||
}
|
||||
}
|
||||
|
||||
void CLogWindow::SaveSettings()
|
||||
|
Reference in New Issue
Block a user