X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3892380ca140d1be955a8cf79d16310479f484c2..178572bba583f5bd0096a3203acfe8128af0de6b:/src/common/hash.cpp diff --git a/src/common/hash.cpp b/src/common/hash.cpp index 900219c6d1..1c268e7c97 100644 --- a/src/common/hash.cpp +++ b/src/common/hash.cpp @@ -370,6 +370,7 @@ bool wxHashTable::Create(int the_key_type, int size) void wxHashTable::DoCopy(const wxHashTable& table) { n = table.n; + m_count = table.m_count; current_position = table.current_position; current_node = NULL; // doesn't matter - Next() will reconstruct it key_type = table.key_type; @@ -395,7 +396,7 @@ void wxHashTable::Put (long key, long value, wxObject * object) if (!hash_table[position]) { - hash_table[position] = new wxList (wxKEY_STRING); + hash_table[position] = new wxList (wxKEY_INTEGER); if (m_deleteContents) hash_table[position]->DeleteContents(TRUE); } @@ -413,7 +414,7 @@ void wxHashTable::Put (long key, const wxChar *value, wxObject * object) if (!hash_table[position]) { - hash_table[position] = new wxList (wxKEY_INTEGER); + hash_table[position] = new wxList (wxKEY_STRING); if (m_deleteContents) hash_table[position]->DeleteContents(TRUE); } @@ -681,11 +682,14 @@ void wxHashTable::DeleteContents (bool flag) void wxHashTable::Clear () { - int i; - for (i = 0; i < n; i++) + int i; + if (hash_table) { - if (hash_table[i]) - hash_table[i]->Clear (); + for (i = 0; i < n; i++) + { + if (hash_table[i]) + hash_table[i]->Clear (); + } } m_count = 0; }