mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-04 13:57:43 -07:00
FIX: crash if the catched object becomes wild pointer
jira: [none] Change-Id: I5082ab58f4a6c7177758efcd7ff66a9f73bd0efa (cherry picked from commit b2256c828b45b1734dd9793752a54e22a98b073c)
This commit is contained in:
parent
b7460cf30a
commit
e268e5923d
1 changed files with 12 additions and 12 deletions
|
|
@ -2710,6 +2710,8 @@ void StatusPanel::show_recenter_dialog() {
|
|||
|
||||
void StatusPanel::show_error_message(MachineObject *obj, bool is_exist, wxString msg, std::string print_error_str, wxString image_url, std::vector<int> used_button)
|
||||
{
|
||||
const std::string &dev_id = obj ? obj->dev_id : string();
|
||||
|
||||
if (is_exist && msg.IsEmpty()) {
|
||||
error_info_reset();
|
||||
} else {
|
||||
|
|
@ -2723,13 +2725,12 @@ void StatusPanel::show_error_message(MachineObject *obj, bool is_exist, wxString
|
|||
|
||||
m_print_error_dlg->update_title_style(_L("Error"), used_button, this);
|
||||
m_print_error_dlg->update_text_image(msg, print_error_str, image_url);
|
||||
m_print_error_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, obj](wxCommandEvent& e) {
|
||||
if (obj) {
|
||||
obj->command_clean_print_error(obj->subtask_id_, obj->print_error);
|
||||
}
|
||||
});
|
||||
m_print_error_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, dev_id](wxCommandEvent &e) {
|
||||
MachineObject* the_obj = wxGetApp().getDeviceManager()->get_my_machine(dev_id);
|
||||
if (the_obj) { the_obj->command_clean_print_error(the_obj->subtask_id_, the_obj->print_error); }
|
||||
});
|
||||
|
||||
m_print_error_dlg->Bind(EVT_SECONDARY_CHECK_RETRY, [this, obj](wxCommandEvent& e) {
|
||||
m_print_error_dlg->Bind(EVT_SECONDARY_CHECK_RETRY, [this](wxCommandEvent& e) {
|
||||
if (m_ams_control) {
|
||||
m_ams_control->on_retry();
|
||||
}
|
||||
|
|
@ -2769,13 +2770,12 @@ void StatusPanel::show_error_message(MachineObject *obj, bool is_exist, wxString
|
|||
m_print_error_dlg_no_action->update_title_style(_L("Warning"), SecondaryCheckDialog::ButtonStyle::ONLY_CONFIRM, this);
|
||||
}
|
||||
m_print_error_dlg_no_action->update_text(error_code_msg);
|
||||
m_print_error_dlg_no_action->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, obj](wxCommandEvent& e) {
|
||||
if (obj) {
|
||||
obj->command_clean_print_error(obj->subtask_id_, obj->print_error);
|
||||
}
|
||||
});
|
||||
m_print_error_dlg_no_action->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, dev_id](wxCommandEvent &e) {
|
||||
MachineObject *the_obj = wxGetApp().getDeviceManager()->get_my_machine(dev_id);
|
||||
if (the_obj) { the_obj->command_clean_print_error(the_obj->subtask_id_, the_obj->print_error); }
|
||||
});
|
||||
|
||||
m_print_error_dlg_no_action->Bind(EVT_SECONDARY_CHECK_RETRY, [this, obj](wxCommandEvent& e) {
|
||||
m_print_error_dlg_no_action->Bind(EVT_SECONDARY_CHECK_RETRY, [this](wxCommandEvent& e) {
|
||||
if (m_ams_control) {
|
||||
m_ams_control->on_retry();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue