[irstlm] 106/126: solved a memory leak

Giulio Paci giuliopaci-guest at moszumanska.debian.org
Tue May 17 07:46:50 UTC 2016


This is an automated email from the git hooks/post-receive script.

giuliopaci-guest pushed a commit to annotated tag adaptiveLM.v0.1
in repository irstlm.

commit 65a906a665dc38b43e09f81fef22d31e5a78e2d5
Author: Nicola Bertoldi <bertoldi at fbk.eu>
Date:   Wed Sep 23 12:23:46 2015 +0200

    solved a memory leak
---
 src/context-dependent-evaluation.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/context-dependent-evaluation.cpp b/src/context-dependent-evaluation.cpp
index fb580d4..9928635 100644
--- a/src/context-dependent-evaluation.cpp
+++ b/src/context-dependent-evaluation.cpp
@@ -559,7 +559,8 @@ int main(int argc, char **argv)
 					//variables for the computation of the mass probability related to the current word, i.e. the sum of the probs for all words associated with the current word
 					double current_tot_pr = pow(10.0,current_Pr);
 //					for (int j=0; j<current_dict->size(); ++j){
-					for (int j=1; j<current_dict->size(); ++j){
+					for (int j=1; j<current_dict->size(); ++j)
+					{
 						//loop over all words in the LM
 					  tmp_word_vec.at(current_pos) = current_dict->decode(j);
 						IFVERBOSE(3){
@@ -579,6 +580,8 @@ int main(int argc, char **argv)
 						}
 						VERBOSE(3,"current_Pr:" << current_Pr << " current_word:" << current_word << "| ===> code:" << j << " word:|" << tmp_word_vec.at(current_pos) << "| pr:" << pr << " versus best_code:" << best_code << " best_word:|" << current_dict->decode(best_code) << "| best_pr:" << best_pr << std::endl);
 					}
+					delete current_dict;
+					
 					current_tot_pr=log10(current_tot_pr);
 					
 					model_Pr = best_pr;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/irstlm.git



More information about the debian-science-commits mailing list