From 9dd993950a637157c37f33a1f835ac447fa7b32f Mon Sep 17 00:00:00 2001 From: tensor-tang Date: Wed, 6 Jun 2018 21:20:17 +0800 Subject: [PATCH] fix free --- paddle/contrib/inference/demo/simple_on_word2vec.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/contrib/inference/demo/simple_on_word2vec.cc b/paddle/contrib/inference/demo/simple_on_word2vec.cc index 113f3c774e..a4ef3b71c5 100644 --- a/paddle/contrib/inference/demo/simple_on_word2vec.cc +++ b/paddle/contrib/inference/demo/simple_on_word2vec.cc @@ -61,6 +61,8 @@ void Main(bool use_gpu) { for (size_t i = 0; i < std::min(5UL, num_elements); i++) { LOG(INFO) << static_cast(outputs.front().data.data)[i]; } + // TODO(Superjomn): this is should be free automatically + free(outputs[0].data.data); } } @@ -101,6 +103,7 @@ void MainThreads(int num_threads) { for (size_t i = 0; i < std::min(5UL, num_elements); i++) { LOG(INFO) << static_cast(outputs.front().data.data)[i]; } + free(outputs[0].data.data); } }); } -- GitLab