From 5371f9864b11f46944de4f3c17f4636daa754e83 Mon Sep 17 00:00:00 2001 From: liuqi Date: Mon, 25 Mar 2019 16:00:45 +0800 Subject: [PATCH] BUG: memory leak gemm_context_ object(2097840 bytes) in cpu_runtime.h --- mace/core/runtime/cpu/cpu_runtime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mace/core/runtime/cpu/cpu_runtime.h b/mace/core/runtime/cpu/cpu_runtime.h index bb97267f..ab067eba 100644 --- a/mace/core/runtime/cpu/cpu_runtime.h +++ b/mace/core/runtime/cpu/cpu_runtime.h @@ -52,13 +52,13 @@ class CPURuntime { #ifdef MACE_ENABLE_QUANTIZE ~CPURuntime() { - if (!gemm_context_) { + if (gemm_context_ != nullptr) { delete static_cast(gemm_context_); } } gemmlowp::GemmContext *GetGemmlowpContext() { - if (!gemm_context_) { + if (gemm_context_ == nullptr) { gemm_context_ = new gemmlowp::GemmContext(); } return static_cast(gemm_context_); -- GitLab