SET(RSPAMD_VERSION_MAJOR 0)
SET(RSPAMD_VERSION_MINOR 4)
-SET(RSPAMD_VERSION_PATCH 1)
+SET(RSPAMD_VERSION_PATCH 2)
SET(RSPAMD_VERSION "${RSPAMD_VERSION_MAJOR}.${RSPAMD_VERSION_MINOR}.${RSPAMD_VERSION_PATCH}")
metric_res = memory_pool_alloc (task->task_pool, sizeof (struct metric_result));
metric_res->symbols = g_hash_table_new (g_str_hash, g_str_equal);
metric_res->checked = FALSE;
- memory_pool_add_destructor (task->task_pool, (pool_destruct_func) g_hash_table_destroy, metric_res->symbols);
+ memory_pool_add_destructor (task->task_pool, (pool_destruct_func) g_hash_table_unref, metric_res->symbols);
metric_res->metric = metric;
metric_res->grow_factor = 0;
metric_res->score = 0;
if (task->tokens == NULL) {
task->tokens = g_hash_table_new (g_direct_hash, g_direct_equal);
- memory_pool_add_destructor (task->task_pool, (pool_destruct_func)g_hash_table_destroy, task->tokens);
+ memory_pool_add_destructor (task->task_pool, (pool_destruct_func)g_hash_table_unref, task->tokens);
}
g_list_foreach (task->cfg->classifiers, classifiers_callback, task);
{
cd->cur_metric = metric_res->metric;
if (cd->alive) {
+ g_hash_table_ref (metric_res->symbols);
g_hash_table_foreach (metric_res->symbols, metric_symbols_callback_rspamc, cd);
+ g_hash_table_unref (metric_res->symbols);
/* Remove last , from log buf */
if (cd->log_buf[cd->log_offset - 1] == ',') {
cd->log_buf[--cd->log_offset] = '\0';
" \"symbols\": [");
/* Print all symbols */
+ g_hash_table_ref (metric_res->symbols);
g_hash_table_foreach (metric_res->symbols, metric_symbols_callback_json, cd);
+ g_hash_table_unref (metric_res->symbols);
/* Remove last ',' symbol */
if (cd->symbols_buf[cd->symbols_offset - 1] == ',') {
cd->symbols_buf[--cd->symbols_offset] = '\0';
g_hash_table_remove (task->results, "default");
/* Write result for each metric separately */
+ g_hash_table_ref (task->results);
g_hash_table_foreach (task->results, show_metric_result, &cd);
+ g_hash_table_unref (task->results);
if (!cd.alive) {
return FALSE;
}
g_hash_table_remove (task->results, "default");
/* Write result for each metric separately */
+ g_hash_table_ref (task->results);
g_hash_table_foreach (task->results, show_metric_result, &cd);
+ g_hash_table_unref (task->results);
if (! cd.alive) {
return FALSE;
}