!32512 [MS][LITE][parallel predict] fix bug of delete

Merge pull request !32512 from yefeng/280-fix_bug
This commit is contained in:
i-robot 2022-04-06 02:43:59 +00:00 committed by Gitee
commit f66d08fe1d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 1 deletions

View File

@ -624,7 +624,9 @@ Status ModelPool::Predict(const std::vector<MSTensor> &inputs, std::vector<MSTen
}
ModelPool::~ModelPool() {
predict_task_queue_->SetPredictTaskDone();
if (predict_task_queue_ != nullptr) {
predict_task_queue_->SetPredictTaskDone();
}
for (auto &th : model_worker_vec_) {
if (th.joinable()) {
th.join();