Skip to content
Snippets Groups Projects
Commit b5fc952d authored by Markus Blatt's avatar Markus Blatt
Browse files

[BugFix] Correctly release memory of std::vector

Previously this code was plain wrong. It actually made a copy
of the vector and tried to swap its entries with the original vector.
The argument to swap even was a const reference!
Now we use the correct trick: vector().swap(other).
parent 2ab3a567
No related branches found
No related tags found
No related merge requests found
......@@ -928,8 +928,7 @@ namespace Dune
template<class I, class S, class D>
void OverlappingSchwarzInitializer<I,S,D>::createMatrix() const
{
indexMaps.clear();
indexMaps.swap(std::vector<IndexMap>(indexMaps));
std::vector<IndexMap>().swap(indexMaps);
std::for_each(initializers->begin(), initializers->end(),
std::mem_fun_ref(&AtomInitializer::createMatrix));
}
......
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