From fdd4c6ca42ba1d7dcd05e191b1fba266c8d34fa7 Mon Sep 17 00:00:00 2001 From: Yijia Liu Date: Sat, 10 Sep 2016 10:34:43 +0800 Subject: [PATCH] fix issue #183 --- src/parser.n/parser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser.n/parser.cpp b/src/parser.n/parser.cpp index 892ec651a..b1bf3e4b5 100644 --- a/src/parser.n/parser.cpp +++ b/src/parser.n/parser.cpp @@ -444,7 +444,7 @@ bool NeuralNetworkParser::load(const std::string& filename) { for (size_t i = 0; i < now; i += 2) { precomputation_id_encoder[payload[i]] = payload[i+1]; } - delete payload; + delete [] payload; if (use_cluster) { cluster4_types_alphabet.load(ifs); @@ -457,7 +457,7 @@ bool NeuralNetworkParser::load(const std::string& filename) { for (size_t i = 0; i < now; i += 2) { form_to_cluster4[payload[i]] = payload[i+1]; } - delete payload; + delete [] payload; now= read_uint(ifs); payload = new int[now]; @@ -465,7 +465,7 @@ bool NeuralNetworkParser::load(const std::string& filename) { for (size_t i = 0; i < now; i += 2) { form_to_cluster6[payload[i]] = payload[i+1]; } - delete payload; + delete [] payload; now= read_uint(ifs); payload = new int[now]; @@ -473,7 +473,7 @@ bool NeuralNetworkParser::load(const std::string& filename) { for (size_t i = 0; i < now; i += 2) { form_to_cluster[payload[i]] = payload[i+1]; } - delete payload; + delete [] payload; } classifier.canonical();