Fix merge function

Fixes memory leaks, and maybe some other potential problems
This commit is contained in:
Clement Jamin 2014-07-07 13:41:33 +02:00
parent bc4cb0d3f3
commit f7396790ff
1 changed files with 1 additions and 0 deletions

View File

@ -693,6 +693,7 @@ void Concurrent_compact_container<T, Allocator>::merge(Self &d)
set_type(d.m_first_item, m_last_item, BLOCK_BOUNDARY);
m_last_item = d.m_last_item;
}
m_all_items.insert(m_all_items.end(), d.m_all_items.begin(), d.m_all_items.end());
// Add the capacities.
m_capacity += d.m_capacity;
// It seems reasonnable to take the max of the block sizes.