diff --git a/headers/private/servers/app/HashTable.h b/headers/private/servers/app/HashTable.h index 5913d3560d..6c50f77699 100644 --- a/headers/private/servers/app/HashTable.h +++ b/headers/private/servers/app/HashTable.h @@ -20,7 +20,7 @@ class Hashable { class HashTable { public: - HashTable(int32 capacity = 100, float loadFactor = 0.75); + HashTable(bool owning = false, int32 capacity = 100, float loadFactor = 0.75); ~HashTable(); void MakeEmpty(bool deleteValues = true); @@ -42,6 +42,7 @@ class HashTable { entry** fTable; int32 fCapacity, fCount, fThreshold; float fLoadFactor; + bool fOwning; }; #endif /* HASHTABLE_H */ diff --git a/src/servers/app/HashTable.cpp b/src/servers/app/HashTable.cpp index 19a954d9d2..2d0ee7cea1 100644 --- a/src/servers/app/HashTable.cpp +++ b/src/servers/app/HashTable.cpp @@ -22,11 +22,12 @@ struct HashTable::entry { }; -HashTable::HashTable(int32 capacity, float loadFactor) +HashTable::HashTable(bool owning, int32 capacity, float loadFactor) : fTable(NULL), fCount(0), - fThreshold(0) + fThreshold(0), + fOwning(owning) { if (capacity < 10) capacity = 10; @@ -40,7 +41,7 @@ HashTable::HashTable(int32 capacity, float loadFactor) HashTable::~HashTable() { - MakeEmpty(); + MakeEmpty(fOwning); }