mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-03-13 06:46:11 -06:00
FIX: fix crash and blank page while cancel printing at 75 percent
jira: [STUDIO-11861] Change-Id: I142df41ade73558849183fd245163cb5a7367f9c (cherry picked from commit ddf4e9bc9f73b5cf7c50e74b66a98716d0f81d16)
This commit is contained in:
parent
d3a29b763c
commit
5647312a16
3 changed files with 28 additions and 17 deletions
|
|
@ -722,17 +722,7 @@ MachineObject::~MachineObject()
|
|||
model_task = nullptr;
|
||||
}
|
||||
|
||||
if (get_slice_info_thread) {
|
||||
if (get_slice_info_thread->joinable()) {
|
||||
get_slice_info_thread->join();
|
||||
get_slice_info_thread = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (slice_info) {
|
||||
delete slice_info;
|
||||
slice_info = nullptr;
|
||||
}
|
||||
free_slice_info();
|
||||
|
||||
for (auto it = amsList.begin(); it != amsList.end(); it++) {
|
||||
for (auto tray_it = it->second->trayList.begin(); tray_it != it->second->trayList.end(); tray_it++) {
|
||||
|
|
@ -5437,10 +5427,6 @@ void MachineObject::set_modeltask(BBLModelTask* task)
|
|||
model_task = task;
|
||||
}
|
||||
|
||||
void MachineObject::set_slice_info(BBLSliceInfo *info) {
|
||||
slice_info = info;
|
||||
}
|
||||
|
||||
void MachineObject::update_model_task()
|
||||
{
|
||||
if (request_model_result > 10) return;
|
||||
|
|
@ -5538,6 +5524,27 @@ void MachineObject::update_model_task()
|
|||
});
|
||||
}
|
||||
|
||||
void MachineObject::free_slice_info()
|
||||
{
|
||||
if (get_slice_info_thread)
|
||||
{
|
||||
if (get_slice_info_thread->joinable())
|
||||
{
|
||||
get_slice_info_thread->interrupt();
|
||||
get_slice_info_thread->join();
|
||||
}
|
||||
|
||||
delete get_slice_info_thread;
|
||||
get_slice_info_thread = nullptr;
|
||||
}
|
||||
|
||||
if (slice_info)
|
||||
{
|
||||
delete slice_info;
|
||||
slice_info = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void MachineObject::update_slice_info(std::string project_id, std::string profile_id, std::string subtask_id, int plate_idx)
|
||||
{
|
||||
if (!m_agent) return;
|
||||
|
|
@ -5563,6 +5570,8 @@ void MachineObject::update_slice_info(std::string project_id, std::string profil
|
|||
int plate_index = -1;
|
||||
|
||||
if (!m_agent) return;
|
||||
if (!slice_info) return;
|
||||
if (get_slice_info_thread->interruption_requested()) { return;}
|
||||
|
||||
if (plate_idx >= 0) {
|
||||
plate_index = plate_idx;
|
||||
|
|
|
|||
|
|
@ -1302,8 +1302,10 @@ public:
|
|||
BBLSubTask* get_subtask();
|
||||
BBLModelTask* get_modeltask();
|
||||
void set_modeltask(BBLModelTask* task);
|
||||
void set_slice_info(BBLSliceInfo *info);
|
||||
|
||||
void update_model_task();
|
||||
|
||||
void free_slice_info();
|
||||
void update_slice_info(std::string project_id, std::string profile_id, std::string subtask_id, int plate_idx);
|
||||
|
||||
bool m_firmware_valid { false };
|
||||
|
|
|
|||
|
|
@ -3815,7 +3815,7 @@ void StatusPanel::update_cloud_subtask(MachineObject *obj)
|
|||
|
||||
if (is_task_changed(obj)) {
|
||||
obj->set_modeltask(nullptr);
|
||||
obj->set_slice_info(nullptr);
|
||||
obj->free_slice_info();
|
||||
reset_printing_values();
|
||||
BOOST_LOG_TRIVIAL(info) << "monitor: change to sub task id = " << obj->subtask_->task_id;
|
||||
if (web_request.IsOk() && web_request.GetState() == wxWebRequest::State_Active) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue