3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-11 03:33:35 +00:00

vector: make expand_vector() less prone to mem leaks by calling the destructors after move

This commit is contained in:
Nuno Lopes 2017-10-15 03:52:11 +01:00
parent e7f0f3b834
commit d18e975a49

View file

@ -91,6 +91,7 @@ class vector {
int i = 0;
for (auto I = old_data; I != old_data + old_size; ++I) {
new (&m_data[i++]) T(std::move(*I));
I->~T();
}
memory::deallocate(old_mem);
}