diff --git a/src/slic3r/GUI/BindDialog.cpp b/src/slic3r/GUI/BindDialog.cpp index bf27a7c9d..d24853fc6 100644 --- a/src/slic3r/GUI/BindDialog.cpp +++ b/src/slic3r/GUI/BindDialog.cpp @@ -804,6 +804,7 @@ UnBindMachineDialog::UnBindMachineDialog(Plater *plater /*= nullptr*/) UnBindMachineDialog::~UnBindMachineDialog() { + web_request.Cancel(); m_button_unbind->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(UnBindMachineDialog::on_unbind_printer), NULL, this); m_button_cancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(UnBindMachineDialog::on_cancel), NULL, this); } @@ -873,11 +874,11 @@ void UnBindMachineDialog::on_show(wxShowEvent &event) wxString username_text = from_u8(wxGetApp().getAgent()->get_user_name()); m_user_name->SetLabelText(username_text); wxString avatar_url = wxGetApp().getAgent()->get_user_avatar(); - wxWebRequest request = wxWebSession::GetDefault().CreateRequest(this, avatar_url); - if (!request.IsOk()) { + web_request = wxWebSession::GetDefault().CreateRequest(this, avatar_url); + if (!web_request.IsOk()) { // todo request fail } - request.Start(); + web_request.Start(); } Layout(); diff --git a/src/slic3r/GUI/BindDialog.hpp b/src/slic3r/GUI/BindDialog.hpp index 8a429d58b..f66f1e7cf 100644 --- a/src/slic3r/GUI/BindDialog.hpp +++ b/src/slic3r/GUI/BindDialog.hpp @@ -108,6 +108,7 @@ protected: MachineObject *m_machine_info{nullptr}; wxStaticBitmap *m_avatar; wxStaticBitmap *m_printer_img; + wxWebRequest web_request; public: UnBindMachineDialog(Plater *plater = nullptr);