From: Hyunsoo Park Date: Fri, 6 Sep 2019 06:28:24 +0000 (+0900) Subject: Sets NULL to pointer variable. X-Git-Tag: submit/tizen/20190924.061550~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad525ac21b66fa94a1c633eb9958039bd579ae0f;p=platform%2Fcore%2Fmultimedia%2Finference-engine-opencv.git Sets NULL to pointer variable. C++ delete method just release allocated memory. It doesn't set NULL value to variable. So i make variable to NULL after delete process. Change-Id: I42661f77ff3bcc2b0dafbb3b37741cc8c0d4e720 Signed-off-by: Hyunsoo Park --- diff --git a/packaging/inference-engine-opencv.spec b/packaging/inference-engine-opencv.spec index 77dd3c4..285a6bd 100644 --- a/packaging/inference-engine-opencv.spec +++ b/packaging/inference-engine-opencv.spec @@ -1,7 +1,7 @@ Name: inference-engine-opencv Summary: OpenCV based implementation of inference-engine-interface Version: 0.0.1 -Release: 4 +Release: 5 Group: Multimedia/Libraries License: Apache-2.0 Source0: %{name}-%{version}.tar.gz diff --git a/src/inference_engine_opencv.cpp b/src/inference_engine_opencv.cpp index f8dece3..5cd4423 100644 --- a/src/inference_engine_opencv.cpp +++ b/src/inference_engine_opencv.cpp @@ -27,7 +27,7 @@ namespace InferenceEngineImpl { namespace OpenCVImpl { -InferenceOpenCV::InferenceOpenCV(std::string protoFile, std::string weightFile, +InferenceOpenCV::InferenceOpenCV(std::string protoFile, std::string weightFile, std::string userFile) : mNet(), mConfigFile(protoFile), @@ -151,7 +151,7 @@ int InferenceOpenCV::Load() { int ret = INFERENCE_ENGINE_ERROR_NONE; - if (access(mConfigFile.c_str(), F_OK) || + if (access(mConfigFile.c_str(), F_OK) || access(mWeightFile.c_str(), F_OK)) { LOGE("protofile in [%s] ", mConfigFile.c_str()); LOGE("weightFilePath in [%s] ", mWeightFile.c_str()); @@ -272,7 +272,7 @@ int InferenceOpenCV::GetInferenceResult(ImageClassificationResults& results) LOGI("test...."); LOGI("names: %s", mUserListName[classIdx].c_str()); results.names.push_back(mUserListName[classIdx]); - + } results.number_of_classes = mOutputNumbers; @@ -448,7 +448,7 @@ class IInferenceEngineCommon* EngineCommonInit(std::string protoFile, std::strin void EngineCommonDestroy(class IInferenceEngineCommon *engine) { - delete engine; + delete engine; } } } /* OpenCVImpl */