FIX:fix the issue of macOS crashing easily

Change-Id: I7378a28734e46c4126ab0216dc93d45a10bcd451
This commit is contained in:
tao wang 2024-10-17 10:34:11 +08:00 committed by Lane.Wei
parent fce2c9d401
commit 35b0ef0cd7
1 changed files with 7 additions and 11 deletions

View File

@ -4566,16 +4566,21 @@ void SelectMachineDialog::sys_color_changed()
bool SelectMachineDialog::Show(bool show)
{
show_status(PrintDialogStatus::PrintStatusInit);
// set default value when show this dialog
if (show) {
m_refresh_timer->Start(LIST_REFRESH_INTERVAL);
show_status(PrintDialogStatus::PrintStatusInit);
wxGetApp().UpdateDlgDarkUI(this);
wxGetApp().reset_to_active();
set_default();
update_user_machine_list();
Layout();
Fit();
CenterOnParent();
}
else {
m_refresh_timer->Stop();
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
if (dev) {
MachineObject* obj_ = dev->get_selected_machine();
@ -4587,15 +4592,6 @@ bool SelectMachineDialog::Show(bool show)
}
}
}
if (show) {
m_refresh_timer->Start(LIST_REFRESH_INTERVAL);
} else {
m_refresh_timer->Stop();
}
Layout();
Fit();
if (show) { CenterOnParent(); }
return DPIDialog::Show(show);
}