FIX: [STUDIO-3046] prevent wxGuiLog on app quit

Change-Id: I1a973a5e42eb286935317fdd8b6d08fb90a2f429
This commit is contained in:
chunmao.guo 2023-05-31 14:17:11 +08:00 committed by Lane.Wei
parent 4c020fe102
commit ec94c46665
2 changed files with 9 additions and 3 deletions

View file

@ -2253,10 +2253,17 @@ bool GUI_App::OnInit()
class wxBoostLog : public wxLog
{
void DoLogText(const wxString &msg) {
void DoLogText(const wxString &msg) override {
BOOST_LOG_TRIVIAL(warning) << msg.ToUTF8().data();
}
~wxBoostLog() override
{
// This is a hack. Prevent thread logs from going to wxGuiLog on app quit.
auto t = wxLog::SetActiveTarget(this);
wxLog::FlushActive();
wxLog::SetActiveTarget(t);
}
};
bool GUI_App::on_init_inner()

View file

@ -475,10 +475,9 @@ void DropDown::mouseWheelMoved(wxMouseEvent &event)
// currently unused events
void DropDown::sendDropDownEvent()
{
selection = hover_item;
wxCommandEvent event(wxEVT_COMBOBOX, GetId());
event.SetEventObject(this);
event.SetInt(selection);
event.SetInt(hover_item);
event.SetString(GetValue());
GetEventHandler()->ProcessEvent(event);
}