mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-11-02 20:51:23 -07:00 
			
		
		
		
	FIX: [STUDIO-3532] cancel web request on unbind dialog
Change-Id: I4830dcc32de4daec47066539bb8eaa12a51adfbd
This commit is contained in:
		
							parent
							
								
									1d8489cfb4
								
							
						
					
					
						commit
						ea97a9aa33
					
				
					 2 changed files with 5 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -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();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue