Skip to content
Permalink
Browse files

Free allocated memory after reading data.

Free memory allocated to modelBuff after reading the data and calling the appropriate method.
  • Loading branch information...
PawanKartikS committed Mar 15, 2019
1 parent f6e4504 commit 90c6aabcc0c249105cb78d9d0bbb797e055b375b
Showing with 2 additions and 1 deletion.
  1. +2 −1 cpp/src/Bonsai/BonsaiModel.cpp
@@ -25,6 +25,7 @@ BonsaiModel::BonsaiModel(
infile.close();

(isDense) ? importModel(modelSize, modelBuff) : importSparseModel(modelSize, modelBuff);
delete[] modelBuff;
}

BonsaiModel::BonsaiModel(
@@ -412,4 +413,4 @@ size_t BonsaiModel::totalNonZeros()
{
return Bonsai::countnnz(params.Z) + Bonsai::countnnz(params.W) +
Bonsai::countnnz(params.V) + Bonsai::countnnz(params.Theta);
}
}

0 comments on commit 90c6aab

Please sign in to comment.
You can’t perform that action at this time.