FIX:fixed studio crash caused by HTTP request blocking

jira:[STUDIO-3849]

Change-Id: I6348af96014e80da6b720da48239fed262f0f3c5
(cherry picked from commit 87c996c15db0bd7b1ce075004605490fdeb1f979)
This commit is contained in:
tao wang 2023-08-23 20:41:07 +08:00 committed by Lane.Wei
parent 061a2cdb7e
commit 50f9edec5c
5 changed files with 14 additions and 9 deletions

View file

@ -2695,6 +2695,11 @@ void StatusPanel::update_basic_print_data(bool def)
void StatusPanel::update_model_info()
{
auto get_subtask_fn = [this](BBLModelTask* subtask) {
obj->set_modeltask(subtask);
};
if (wxGetApp().getAgent() && obj) {
BBLSubTask* curr_task = obj->get_subtask();
@ -2703,11 +2708,7 @@ void StatusPanel::update_model_info()
if (!curr_model_task) {
curr_model_task = new BBLModelTask();
curr_model_task->task_id = curr_task->task_id;
int result = wxGetApp().getAgent()->get_subtask(curr_model_task);
if (result > -1) {
obj->set_modeltask(curr_model_task);
}
wxGetApp().getAgent()->get_subtask(curr_model_task, get_subtask_fn);
}
}
}