Skip to content
Snippets Groups Projects
Commit 4e7fecf0 authored by Tom Fischer's avatar Tom Fischer Committed by Dmitri Naumov
Browse files

[MeL] Fix mem leak in TemplateElement constructor.

parent 1c0b1e83
No related branches found
No related tags found
No related merge requests found
......@@ -18,8 +18,10 @@ TemplateElement<ELEMENT_RULE>::TemplateElement(Node* nodes[n_all_nodes],
: Element(id)
{
std::copy_n(nodes, n_all_nodes, std::begin(_nodes));
delete[] nodes;
this->_neighbors = new Element*[getNumberOfNeighbors()];
std::fill(this->_neighbors, this->_neighbors + getNumberOfNeighbors(), nullptr);
std::fill(this->_neighbors, this->_neighbors + getNumberOfNeighbors(),
nullptr);
this->space_dimension_ = ELEMENT_RULE::dimension;
}
......
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