Skip to content

Commit 9dd9939

Browse files
committed
fix free
1 parent e797dd1 commit 9dd9939

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

paddle/contrib/inference/demo/simple_on_word2vec.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ void Main(bool use_gpu) {
6161
for (size_t i = 0; i < std::min(5UL, num_elements); i++) {
6262
LOG(INFO) << static_cast<float*>(outputs.front().data.data)[i];
6363
}
64+
// TODO(Superjomn): this is should be free automatically
65+
free(outputs[0].data.data);
6466
}
6567
}
6668

@@ -101,6 +103,7 @@ void MainThreads(int num_threads) {
101103
for (size_t i = 0; i < std::min(5UL, num_elements); i++) {
102104
LOG(INFO) << static_cast<float*>(outputs.front().data.data)[i];
103105
}
106+
free(outputs[0].data.data);
104107
}
105108
});
106109
}

0 commit comments

Comments
 (0)