diff --git a/mace/core/runtime/cpu/cpu_runtime.h b/mace/core/runtime/cpu/cpu_runtime.h index bb97267f67f46f1bb47b1729d162985b055418f7..ab067ebaae698e2296dcee5469c93961f654b628 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_);