diff --git a/sourcehook/sh_tinyhash.h b/sourcehook/sh_tinyhash.h index 52b6e85..a7ddddd 100644 --- a/sourcehook/sh_tinyhash.h +++ b/sourcehook/sh_tinyhash.h @@ -63,17 +63,11 @@ namespace SourceHook ~THash() { - if (m_Buckets) - delete [] m_Buckets; + _Clear(); } void clear() { - if (m_Buckets) - delete [] m_Buckets; - m_Buckets = NULL; - m_numBuckets = 0; - m_percentUsed = 0.0f; - + _Clear(); _Refactor(); } size_t GetBuckets() @@ -90,6 +84,21 @@ namespace SourceHook return pNode->val; } private: + void _Clear() + { + for (size_t i=0; i + +