]> git.treefish.org Git - phys/latlib.git/blobdiff - datread.cpp
Implemented startconfig.
[phys/latlib.git] / datread.cpp
index 41d3724930f34ebc4b63cfc75a26a87b7cf42fde..4a0e31dc5d112ad182360e074d45372edd33350e 100644 (file)
@@ -26,22 +26,13 @@ int datread::openFile (const string& filename)
     getline(infile, parastring);
   }
 
-  if (inbuffer != NULL)
-    delete inbuffer;
-  
-  inbuffer = new boost::iostreams::filtering_istreambuf;
+  inbuffer = unique_ptr<boost::iostreams::filtering_istreambuf>(new boost::iostreams::filtering_istreambuf);
   inbuffer->push( boost::iostreams::bzip2_decompressor() );
   inbuffer->push(infile);
 
   return 0;
 }
 
-datread::~datread ()
-{
-  if (inbuffer != NULL)
-    delete inbuffer;
-}
-
 int datread::readDataToMem (char *tmpData, long unsigned int dataSize)
 {
   int readturn = -1;