Skip to content
Snippets Groups Projects
Commit 724ab064 authored by Tom Fischer's avatar Tom Fischer
Browse files

[MeL/Elements] unique_ptr instead of raw pointer.

parent 34590cc7
No related branches found
No related tags found
No related merge requests found
......@@ -110,7 +110,8 @@ ElementErrorCode PyramidRule5::validate(const Element* e)
ElementErrorCode error_code;
error_code[ElementErrorFlag::ZeroVolume] = e->hasZeroVolume();
const auto* base(dynamic_cast<const MeshLib::Quad*>(e->getFace(4)));
std::unique_ptr<MeshLib::Quad const> const base{
dynamic_cast<MeshLib::Quad const*>(e->getFace(4))};
if (base)
{
error_code |= base->validate();
......@@ -120,7 +121,6 @@ ElementErrorCode PyramidRule5::validate(const Element* e)
{
error_code.set(ElementErrorFlag::NodeOrder);
}
delete base;
return error_code;
}
......
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