diff --git a/client/app.cpp b/client/app.cpp index a7fe77ae5c..54e033e852 100644 --- a/client/app.cpp +++ b/client/app.cpp @@ -184,6 +184,7 @@ int ACTIVE_TASK::preempt(int preempt_type) { result->name ); } + if (task_state() != PROCESS_EXECUTING) return 0; return suspend(); } return 0; diff --git a/client/app_control.cpp b/client/app_control.cpp index 0db72e2c72..c4d7bf7a15 100644 --- a/client/app_control.cpp +++ b/client/app_control.cpp @@ -1055,14 +1055,13 @@ int ACTIVE_TASK_SET::abort_project(PROJECT* project) { void ACTIVE_TASK_SET::suspend_all(int reason) { for (unsigned int i=0; itask_state() != PROCESS_EXECUTING) continue; // handle CPU throttling separately // if (reason == SUSPEND_REASON_CPU_THROTTLE) { if (atp->result->dont_throttle()) continue; atp->preempt(REMOVE_NEVER); - continue;; + continue; } #ifdef ANDROID diff --git a/client/client_state.cpp b/client/client_state.cpp index b07e0d1fb1..27124fbfe4 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -864,9 +864,7 @@ bool CLIENT_STATE::poll_slow_events() { if (suspend_reason) { if (!tasks_suspended) { show_suspend_tasks_message(suspend_reason); - if (!tasks_throttled) { - active_tasks.suspend_all(suspend_reason); - } + active_tasks.suspend_all(suspend_reason); } last_suspend_reason = suspend_reason; } else {