From 5d2aacd5b69c420f3fc1f5402a047e04f41d8ef9 Mon Sep 17 00:00:00 2001 From: Pawan Kartik Date: Fri, 17 Apr 2020 21:29:47 +0530 Subject: [PATCH] Free dynamically alloc'd memory. (#128) --- cpp/src/Bonsai/BonsaiPredictor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/src/Bonsai/BonsaiPredictor.cpp b/cpp/src/Bonsai/BonsaiPredictor.cpp index ec73e101..00ef1cc7 100644 --- a/cpp/src/Bonsai/BonsaiPredictor.cpp +++ b/cpp/src/Bonsai/BonsaiPredictor.cpp @@ -317,6 +317,10 @@ void BonsaiPredictor::batchEvaluate( std::ofstream allDumper(dataDir + "/BonsaiResults" + "/resultDump", std::ofstream::out | std::ofstream::app); allDumper << totalNonZeros() << " " << accuracy << " " << currResultsPath << "\n"; allDumper.close(); + + delete[] scoreArray; + delete[] trainvals; + delete[] label; } size_t BonsaiPredictor::totalNonZeros()