From 68aabd78729c3d301f906a591d0e359e054f9ea1 Mon Sep 17 00:00:00 2001 From: wjm Date: Sat, 12 Jun 2021 06:24:26 +0800 Subject: [PATCH] fix --- ge/common/helper/model_cache_helper.cc | 7 +++++++ ge/hybrid/node_executor/hccl/hccl_node_executor.cc | 1 + 2 files changed, 8 insertions(+) diff --git a/ge/common/helper/model_cache_helper.cc b/ge/common/helper/model_cache_helper.cc index 9cd88ef1..0e6c6329 100755 --- a/ge/common/helper/model_cache_helper.cc +++ b/ge/common/helper/model_cache_helper.cc @@ -1679,6 +1679,13 @@ Status ModelCacheHelper::LoadOmModelFromCache(GeModelPtr &ge_model) const { GELOGW("LoadOmModelFromCache: Load model from file failed. ret = %u", ret); return ret; } + std::function callback = [&]() { + if (model_data.model_data != nullptr) { + delete[] reinterpret_cast(model_data.model_data); + model_data.model_data = nullptr; + } + }; + GE_MAKE_GUARD(release, callback); ModelHelper model_helper; ret = model_helper.LoadModel(model_data); diff --git a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc index 7672a1e3..0412e06d 100644 --- a/ge/hybrid/node_executor/hccl/hccl_node_executor.cc +++ b/ge/hybrid/node_executor/hccl/hccl_node_executor.cc @@ -445,6 +445,7 @@ Status AllToAllNodeTask::ExecuteAsync(TaskContext &context, std::function