zetadin - 2015-05-22

I managed to fix the memory issues in my local working copy of the trunk. OBMol::Clear() now completes fine too. Here is the output of diff:

Index: src/formats/xtcformat.cpp
===================================================================
--- src/formats/xtcformat.cpp   (revision 5041)
+++ src/formats/xtcformat.cpp   (working copy)
@@ -184,11 +184,10 @@

       // Convert positions from single to double precision and convert from
       // nm to A
-      std::vector<double> confs;
-      confs.resize(natoms * 3);
+      double* confs=new double [natoms * 3];
       for (int i=0; i < natoms * 3; ++i) // unroll??
-        confs[i] = static_cast<double>(10.0 * floatCoord.at(i));
-
+    confs[i] = static_cast<double>(10.0 * floatCoord.at(i));
+        
       vconf.push_back(&confs[0]);
     }

I don't have the permissions to commit this though.

 

Last edit: zetadin 2015-05-22