[Genabel-commits] r1615 - pkg/OmicABELnoMM/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Feb 18 16:30:13 CET 2014


Author: afrank
Date: 2014-02-18 16:30:13 +0100 (Tue, 18 Feb 2014)
New Revision: 1615

Modified:
   pkg/OmicABELnoMM/src/AIOwrapper.cpp
   pkg/OmicABELnoMM/src/AIOwrapper.h
Log:
Reworked fvi file handler to remove CPPCHECK memory leak warning.

Modified: pkg/OmicABELnoMM/src/AIOwrapper.cpp
===================================================================
--- pkg/OmicABELnoMM/src/AIOwrapper.cpp	2014-02-18 15:16:03 UTC (rev 1614)
+++ pkg/OmicABELnoMM/src/AIOwrapper.cpp	2014-02-18 15:30:13 UTC (rev 1615)
@@ -29,10 +29,8 @@
 
     Fhandler->fakefiles = params.use_fake_files;
 
-//    databel_fvi* Yfvi;
-//    databel_fvi* ALfvi;
-//    databel_fvi* ARfvi;
 
+
     if (!Fhandler->fakefiles)
     {
         Fhandler->fnameAL   = params.fnameAL;
@@ -40,9 +38,9 @@
         Fhandler->fnameY    = params.fnameY;
         Fhandler->fnameOutB = params.fnameOutB;
 
-        databel_fvi* Yfvi  = load_databel_fvi( (Fhandler->fnameY+".fvi").c_str() );
-        databel_fvi* ALfvi = load_databel_fvi( (Fhandler->fnameAL+".fvi").c_str() );
-        databel_fvi* ARfvi = load_databel_fvi( (Fhandler->fnameAR+".fvi").c_str() );
+        Yfvi  = load_databel_fvi( (Fhandler->fnameY+".fvi").c_str() );
+        ALfvi = load_databel_fvi( (Fhandler->fnameAL+".fvi").c_str() );
+        ARfvi = load_databel_fvi( (Fhandler->fnameAR+".fvi").c_str() );
         params.n = ALfvi->fvi_header.numObservations;
         params.m = ARfvi->fvi_header.numVariables / params.r;
         params.t = Yfvi->fvi_header.numVariables;
@@ -94,6 +92,10 @@
     finalize_AL();
     finalize_B();
 
+    delete Yfvi;
+    delete ALfvi;
+    delete ARfvi;
+
     pthread_attr_destroy(&(Fhandler->attr));
 
     pthread_mutex_destroy(&(Fhandler->m_more));

Modified: pkg/OmicABELnoMM/src/AIOwrapper.h
===================================================================
--- pkg/OmicABELnoMM/src/AIOwrapper.h	2014-02-18 15:16:03 UTC (rev 1614)
+++ pkg/OmicABELnoMM/src/AIOwrapper.h	2014-02-18 15:30:13 UTC (rev 1615)
@@ -163,6 +163,9 @@
         type_fileh FHandler;
         type_fileh* Fhandler;
 
+        databel_fvi* Yfvi;
+        databel_fvi* ALfvi;
+        databel_fvi* ARfvi;
 
 
 
@@ -170,9 +173,6 @@
 
 
 
-
-
-
 };
 
 #endif // AIOWRAPPER_H



More information about the Genabel-commits mailing list