mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Merge pull request #4231 from ligfx/fix_sigabrt_when_quitting_from_dock
Move LogWindow/LogConfigWindow destructor logic -> OnClose
This commit is contained in:
commit
10cccd9228
@ -25,13 +25,14 @@ LogConfigWindow::LogConfigWindow(wxWindow* parent, wxWindowID id)
|
||||
_("Log Configuration")),
|
||||
enableAll(true)
|
||||
{
|
||||
Bind(wxEVT_CLOSE_WINDOW, &LogConfigWindow::OnClose, this);
|
||||
SetMinSize(wxSize(100, 100));
|
||||
m_LogManager = LogManager::GetInstance();
|
||||
CreateGUIControls();
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
LogConfigWindow::~LogConfigWindow()
|
||||
void LogConfigWindow::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
SaveSettings();
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ class LogConfigWindow : public wxPanel
|
||||
{
|
||||
public:
|
||||
LogConfigWindow(wxWindow* parent, wxWindowID id = wxID_ANY);
|
||||
~LogConfigWindow();
|
||||
|
||||
void SaveSettings();
|
||||
void LoadSettings();
|
||||
@ -32,6 +31,7 @@ private:
|
||||
|
||||
void CreateGUIControls();
|
||||
void OnVerbosityChange(wxCommandEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
void OnWriteFileChecked(wxCommandEvent& event);
|
||||
void OnWriteConsoleChecked(wxCommandEvent& event);
|
||||
void OnWriteWindowChecked(wxCommandEvent& event);
|
||||
|
@ -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()
|
||||
|
@ -28,7 +28,6 @@ public:
|
||||
CLogWindow(CFrame* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL,
|
||||
const wxString& name = _("Log"));
|
||||
~CLogWindow();
|
||||
|
||||
void SaveSettings();
|
||||
void Log(LogTypes::LOG_LEVELS, const char* text) override;
|
||||
@ -63,5 +62,6 @@ private:
|
||||
void OnWrapLineCheck(wxCommandEvent& event);
|
||||
void OnClear(wxCommandEvent& event);
|
||||
void OnLogTimer(wxTimerEvent& WXUNUSED(event));
|
||||
void RemoveAllListeners();
|
||||
void UpdateLog();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user