FIX: fix crash when close downloadingProgressDialog
Change-Id: Ie35bb83223d70d3d343f795bc449998a4df15500
This commit is contained in:
parent
0e6f857819
commit
edacd17fab
|
@ -51,6 +51,8 @@ DownloadProgressDialog::DownloadProgressDialog(wxString title)
|
||||||
Layout();
|
Layout();
|
||||||
Fit();
|
Fit();
|
||||||
CentreOnParent();
|
CentreOnParent();
|
||||||
|
|
||||||
|
Bind(wxEVT_CLOSE_WINDOW, &DownloadProgressDialog::on_close, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DownloadProgressDialog::Show(bool show)
|
bool DownloadProgressDialog::Show(bool show)
|
||||||
|
@ -91,6 +93,15 @@ bool DownloadProgressDialog::Show(bool show)
|
||||||
return DPIDialog::Show(show);
|
return DPIDialog::Show(show);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DownloadProgressDialog::on_close(wxCloseEvent& event)
|
||||||
|
{
|
||||||
|
if (m_upgrade_job) {
|
||||||
|
m_upgrade_job->cancel();
|
||||||
|
m_upgrade_job->join();
|
||||||
|
}
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
|
||||||
DownloadProgressDialog::~DownloadProgressDialog() {}
|
DownloadProgressDialog::~DownloadProgressDialog() {}
|
||||||
|
|
||||||
void DownloadProgressDialog::on_dpi_changed(const wxRect &suggested_rect) {}
|
void DownloadProgressDialog::on_dpi_changed(const wxRect &suggested_rect) {}
|
||||||
|
|
|
@ -33,6 +33,7 @@ class DownloadProgressDialog : public DPIDialog
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
bool Show(bool show) override;
|
bool Show(bool show) override;
|
||||||
|
void on_close(wxCloseEvent& event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DownloadProgressDialog(wxString title);
|
DownloadProgressDialog(wxString title);
|
||||||
|
@ -42,7 +43,7 @@ public:
|
||||||
void update_release_note(std::string release_note, std::string version);
|
void update_release_note(std::string release_note, std::string version);
|
||||||
|
|
||||||
std::shared_ptr<BBLStatusBarSend> m_status_bar;
|
std::shared_ptr<BBLStatusBarSend> m_status_bar;
|
||||||
std::shared_ptr<UpgradeNetworkJob> m_upgrade_job;
|
std::shared_ptr<UpgradeNetworkJob> m_upgrade_job { nullptr };
|
||||||
wxPanel * m_panel_download;
|
wxPanel * m_panel_download;
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue