mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:04:59 +00:00
Fix dumb bug in HashTable::clear().
We forgot to clear the m_buckets pointer. This meant that multiple calls to clear() would cause trouble.
This commit is contained in:
parent
2b4374d08e
commit
3a4207b863
2 changed files with 4 additions and 4 deletions
|
@ -301,7 +301,10 @@ void HashTable<T, TraitsForT>::rehash(unsigned new_capacity)
|
|||
template<typename T, typename TraitsForT>
|
||||
void HashTable<T, TraitsForT>::clear()
|
||||
{
|
||||
delete [] m_buckets;
|
||||
if (m_buckets) {
|
||||
delete [] m_buckets;
|
||||
m_buckets = nullptr;
|
||||
}
|
||||
m_capacity = 0;
|
||||
m_size = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue