1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Free cmd search index

This commit is contained in:
James Booth 2017-04-07 00:08:54 +01:00
parent fd6620a950
commit 68cb8c9a8e

View File

@ -2298,6 +2298,7 @@ _cmd_index(Command *cmd) {
}
gchar **tokens = g_str_tokenize_and_fold(index_source->str, NULL, NULL);
g_string_free(index_source, TRUE);
GString *index = g_string_new("");
i = 0;
@ -2305,6 +2306,7 @@ _cmd_index(Command *cmd) {
index = g_string_append(index, tokens[i]);
index = g_string_append(index, " ");
}
g_strfreev(tokens);
char *res = index->str;
g_string_free(index, FALSE);
@ -2331,8 +2333,11 @@ cmd_search_index(char *term)
}
curr = g_list_next(curr);
}
g_list_free(index_keys);
}
g_strfreev(processed_terms);
return results;
}
@ -2379,6 +2384,7 @@ void
cmd_uninit(void)
{
cmd_ac_uninit();
g_hash_table_destroy(search_index);
}
gboolean