Skip to content
Snippets Groups Projects
Commit 98305f9d authored by Oliver Sander's avatar Oliver Sander
Browse files

Replace a C pointer by a std::unique_ptr

Simplifies the memory management.
parent 897682a6
1 merge request!49Replace a C pointer by a std::unique_ptr
Pipeline #
...@@ -93,7 +93,7 @@ namespace Dune ...@@ -93,7 +93,7 @@ namespace Dune
void checkInterface(const IS& source, void checkInterface(const IS& source,
const IS& target, MPI_Comm comm) const IS& target, MPI_Comm comm)
{ {
RemoteIndices<IS> *ri=new RemoteIndices<IS>(source, target, comm); auto ri = std::make_unique<RemoteIndices<IS> >(source, target, comm);
ri->template rebuild<true>(); ri->template rebuild<true>();
Interface inf; Interface inf;
typename OwnerOverlapCopyCommunication<int>::OwnerSet flags; typename OwnerOverlapCopyCommunication<int>::OwnerSet flags;
...@@ -113,11 +113,8 @@ namespace Dune ...@@ -113,11 +113,8 @@ namespace Dune
std::cout<<rank<<": redist interface :"<<interface<<std::endl; std::cout<<rank<<": redist interface :"<<interface<<std::endl;
throw "autsch!"; throw "autsch!";
delete ri; }
}else
#endif #endif
delete ri;
} }
void setSetup() void setSetup()
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment