Skip to content
Snippets Groups Projects
Commit 435d5808 authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Use unique_ptr instead of raw pointer

parent eb5c4f3b
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ inline void readBitField(Dune::BitSetVector<ncomp>& field, int size, const std:: ...@@ -17,7 +17,7 @@ inline void readBitField(Dune::BitSetVector<ncomp>& field, int size, const std::
#ifdef HAVE_AMIRAMESH #ifdef HAVE_AMIRAMESH
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
// Load the AmiraMesh file // Load the AmiraMesh file
AmiraMesh* am = AmiraMesh::read(filename.c_str()); std::unique_ptr<AmiraMesh> am(AmiraMesh::read(filename.c_str()));
if (!am) if (!am)
DUNE_THROW(Dune::Exception, "Could not open AmiraMesh file: " << filename); DUNE_THROW(Dune::Exception, "Could not open AmiraMesh file: " << filename);
// check for consistency // check for consistency
...@@ -60,8 +60,6 @@ inline void readBitField(Dune::BitSetVector<ncomp>& field, int size, const std:: ...@@ -60,8 +60,6 @@ inline void readBitField(Dune::BitSetVector<ncomp>& field, int size, const std::
} }
std::cout << "BitField " << filename << " loaded successfully!" << std::endl; std::cout << "BitField " << filename << " loaded successfully!" << std::endl;
delete(am);
#else #else
DUNE_THROW(Dune::Exception,"You need AmiraMesh to use readBitField"); DUNE_THROW(Dune::Exception,"You need AmiraMesh to use readBitField");
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment