mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Free cmd search index
This commit is contained in:
parent
fd6620a950
commit
68cb8c9a8e
@ -2298,6 +2298,7 @@ _cmd_index(Command *cmd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gchar **tokens = g_str_tokenize_and_fold(index_source->str, NULL, NULL);
|
gchar **tokens = g_str_tokenize_and_fold(index_source->str, NULL, NULL);
|
||||||
|
g_string_free(index_source, TRUE);
|
||||||
|
|
||||||
GString *index = g_string_new("");
|
GString *index = g_string_new("");
|
||||||
i = 0;
|
i = 0;
|
||||||
@ -2305,6 +2306,7 @@ _cmd_index(Command *cmd) {
|
|||||||
index = g_string_append(index, tokens[i]);
|
index = g_string_append(index, tokens[i]);
|
||||||
index = g_string_append(index, " ");
|
index = g_string_append(index, " ");
|
||||||
}
|
}
|
||||||
|
g_strfreev(tokens);
|
||||||
|
|
||||||
char *res = index->str;
|
char *res = index->str;
|
||||||
g_string_free(index, FALSE);
|
g_string_free(index, FALSE);
|
||||||
@ -2331,8 +2333,11 @@ cmd_search_index(char *term)
|
|||||||
}
|
}
|
||||||
curr = g_list_next(curr);
|
curr = g_list_next(curr);
|
||||||
}
|
}
|
||||||
|
g_list_free(index_keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_strfreev(processed_terms);
|
||||||
|
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2379,6 +2384,7 @@ void
|
|||||||
cmd_uninit(void)
|
cmd_uninit(void)
|
||||||
{
|
{
|
||||||
cmd_ac_uninit();
|
cmd_ac_uninit();
|
||||||
|
g_hash_table_destroy(search_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user