Browse Source

!10244 call close tsd when c++ library exit

From: @zhoufeng54
Reviewed-by: @kisnwang,@xu-yfei
Signed-off-by: @xu-yfei
tags/v1.1.0
mindspore-ci-bot Gitee 5 years ago
parent
commit
20a1a7d54e
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      mindspore/ccsrc/cxx_api/graph/ms/ms_graph_impl.cc

+ 10
- 0
mindspore/ccsrc/cxx_api/graph/ms/ms_graph_impl.cc View File

@@ -117,6 +117,16 @@ Status MsGraphImpl::FinalizeEnv() {
session::ExecutorManager::Instance().Clear();
device::KernelRuntimeManager::Instance().ClearRuntimeResource();

auto ms_context = MsContext::GetInstance();
if (ms_context == nullptr) {
MS_LOG(ERROR) << "Get Context failed!";
return FAILED;
}
if (!context::CloseTsd(ms_context)) {
MS_LOG(ERROR) << "CloseTsd failed!";
return FAILED;
}

init_flag_ = false;
MS_LOG(INFO) << "End finalize env";
return SUCCESS;


Loading…
Cancel
Save