Call setHashTable before using s_tagDesc

This commit is contained in:
Ai Lin Chia
2017-07-21 13:40:10 +02:00
parent ea6b2b0c56
commit 711e4019ce

@ -1006,6 +1006,9 @@ std::set<int64_t> getDeprecatedTagTypes() {
std::set<int64_t> deprecatedTagTypes;
// initialize m_type
g_tagdb.setHashTable();
for (int32_t i = 0; i < n; ++i) {
if (s_tagDesc[i].m_flags & TDF_DEPRECATED) {
deprecatedTagTypes.emplace(s_tagDesc[i].m_type);
@ -1033,7 +1036,6 @@ void Tagdb::setHashTable ( ) {
return;
}
// the hashtable of TagDescriptors
if ( ! s_ht.set ( 4, sizeof(TagDesc *), 1024, NULL, 0, false, "tgdbtb" ) ) {
log( LOG_WARN, "tagdb: Tagdb hash init failed." );