mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
fix mem leak in buffer and remove copies in interval (#4458)
This commit is contained in:
parent
04829e6b7a
commit
3d98bccc33
3 changed files with 6 additions and 16 deletions
|
@ -43,6 +43,9 @@ protected:
|
|||
T * new_buffer = reinterpret_cast<T*>(memory::allocate(sizeof(T) * new_capacity));
|
||||
for (unsigned i = 0; i < m_pos; ++i) {
|
||||
new (&new_buffer[i]) T(std::move(m_buffer[i]));
|
||||
if (CallDestructors) {
|
||||
m_buffer[i].~T();
|
||||
}
|
||||
}
|
||||
free_memory();
|
||||
m_buffer = new_buffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue