[Genabel-commits] r853 - pkg/ProbABEL/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Mar 18 12:45:33 CET 2012


Author: lckarssen
Date: 2012-03-18 12:45:33 +0100 (Sun, 18 Mar 2012)
New Revision: 853

Modified:
   pkg/ProbABEL/src/data.h
   pkg/ProbABEL/src/main.cpp
Log:
Fixed the memory leaks in ProbABEL's palinear as mentioned in bug #1890.
 


Modified: pkg/ProbABEL/src/data.h
===================================================================
--- pkg/ProbABEL/src/data.h	2012-03-18 10:00:42 UTC (rev 852)
+++ pkg/ProbABEL/src/data.h	2012-03-18 11:45:33 UTC (rev 853)
@@ -60,6 +60,9 @@
 	if (allmeasured[i]==1) nids++;
     }
     fclose(infile);
+
+    delete [] allmeasured;
+
     return(nids);
 }
 
@@ -259,9 +262,11 @@
     }
     ~phedata()
     {
-	//		delete X;
-	//		delete Y;
-	//		delete [] allmeasured;
+	delete [] model_terms;
+	delete [] idnames;
+	delete [] allmeasured;
+	// delete X;
+	// delete Y;
     }
 };
 
@@ -948,7 +953,7 @@
 	    fprintf(stderr,"error: inv file: cannot open file '%s'\n",filename_);
 	}
 
-
+	delete [] line;
     };
 
 

Modified: pkg/ProbABEL/src/main.cpp
===================================================================
--- pkg/ProbABEL/src/main.cpp	2012-03-18 10:00:42 UTC (rev 852)
+++ pkg/ProbABEL/src/main.cpp	2012-03-18 11:45:33 UTC (rev 853)
@@ -1029,5 +1029,23 @@
 
     //delete gtd;
 
+    // Clean up a couple of vectors
+    std::vector<std::ostringstream *>::iterator it = beta_sebeta.begin();
+    while (it != beta_sebeta.end()) {
+    	delete *it;
+    	it++;
+    }
+    it = covvalue.begin();
+    while (it != covvalue.end()) {
+    	delete *it;
+    	it++;
+    }
+    it = chi2.begin();
+    while (it != chi2.end()) {
+    	delete *it;
+    	it++;
+    }
+
+
     return(0);
 }



More information about the Genabel-commits mailing list