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:
parent
e7f0f3b834
commit
d18e975a49
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue