Sets NULL to pointer variable.
authorHyunsoo Park <hance.park@samsung.com>
Fri, 6 Sep 2019 06:28:24 +0000 (15:28 +0900)
committerHyunsoo Park <hance.park@samsung.com>
Mon, 16 Sep 2019 01:44:34 +0000 (10:44 +0900)
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 <hance.park@samsung.com>
packaging/inference-engine-opencv.spec
src/inference_engine_opencv.cpp

index 77dd3c4ffa018917649a66547ab1938307b857ca..285a6bd261c36ffba006596dd5eb6f36b1d7d764 100644 (file)
@@ -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
index f8dece380a83e53d93ae50e359cfdad11a837228..5cd442353e75067711fd756f8213f8cbfcc1c99e 100644 (file)
@@ -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 */