FIX: destory timers & check webview consist

Change-Id: If95a973e1b3c6bf0da3611c30e0e44e191c9b06a
This commit is contained in:
chunmao.guo 2022-08-09 09:20:33 +08:00 committed by Lane.Wei
parent cd3a721f86
commit 7be639019e
8 changed files with 19 additions and 10 deletions

View File

@ -83,6 +83,8 @@ MarkdownTip::MarkdownTip()
_timer->Bind(wxEVT_TIMER, &MarkdownTip::OnTimer, this);
}
MarkdownTip::~MarkdownTip() { delete _timer; }
void MarkdownTip::LoadStyle()
{
_language = GUI::into_u8(GUI::wxGetApp().current_language_code());

View File

@ -28,6 +28,8 @@ private:
MarkdownTip();
~MarkdownTip();
void LoadStyle();
bool ShowTip(wxPoint pos, std::string const &tip, std::string const & tooltip);
@ -48,13 +50,13 @@ private:
void OnTimer(wxTimerEvent& event);
private:
wxWebView* _tipView = NULL;
wxWebView * _tipView = nullptr;
std::string _lastTip;
std::string _pendingScript = " ";
std::string _language;
wxPoint _requestPos;
double _lastHeight = 0;
wxTimer* _timer;
wxTimer* _timer = nullptr;
bool _hide = false;
bool _data_dir = false;
};

View File

@ -129,7 +129,7 @@ MonitorPanel::~MonitorPanel()
if (m_refresh_timer)
m_refresh_timer->Stop();
delete m_refresh_timer;
}
void MonitorPanel::init_bitmap()

View File

@ -105,7 +105,7 @@ private:
wxBitmap m_arrow_img;
int last_wifi_signal = -1;
wxTimer* m_refresh_timer;
wxTimer* m_refresh_timer = nullptr;
int last_status;
bool m_initialized { false };

View File

@ -367,6 +367,8 @@ SelectMachinePopup::SelectMachinePopup(wxWindow *parent)
Bind(EVT_DISSMISS_MACHINE_LIST, &SelectMachinePopup::on_dissmiss_win, this);
}
SelectMachinePopup::~SelectMachinePopup() { delete m_refresh_timer; }
void SelectMachinePopup::Popup(wxWindow *WXUNUSED(focus))
{
BOOST_LOG_TRIVIAL(trace) << "get_print_info: start";
@ -2178,7 +2180,7 @@ bool SelectMachineDialog::Show(bool show)
SelectMachineDialog::~SelectMachineDialog()
{
;
delete m_refresh_timer;
}
EditDevNameDialog::EditDevNameDialog(Plater *plater /*= nullptr*/)

View File

@ -181,7 +181,7 @@ class SelectMachinePopup : public wxPopupTransientWindow
{
public:
SelectMachinePopup(wxWindow *parent);
~SelectMachinePopup() {}
~SelectMachinePopup();
// wxPopupTransientWindow virtual methods are all overridden to log them
virtual void Popup(wxWindow *focus = NULL) wxOVERRIDE;
@ -359,7 +359,7 @@ protected:
void reset_ams_material();
void update_show_status();
wxTimer *m_refresh_timer;
wxTimer *m_refresh_timer { nullptr };
std::shared_ptr<PrintJob> m_print_job;

View File

@ -398,7 +398,10 @@ void WebViewPanel::OnClose(wxCloseEvent& evt)
this->Hide();
}
void WebViewPanel::OnFreshLoginStatus(wxTimerEvent &event) {
void WebViewPanel::OnFreshLoginStatus(wxTimerEvent &event)
{
auto mainframe = Slic3r::GUI::wxGetApp().mainframe;
if (mainframe && mainframe->m_webview == this)
Slic3r::GUI::wxGetApp().get_login_info();
}

View File

@ -36,7 +36,7 @@ namespace Slic3r { namespace GUI {
this->Bind(wxEVT_LEFT_UP, &SideTools::on_mouse_left_up, this);
}
SideTools::~SideTools() {}
SideTools::~SideTools() { delete m_intetval_timer; }
void SideTools::set_none_printer_mode()
{