修复统计、布尔表达式运算、单元测试模块中的内存泄漏。
This commit is contained in:
@@ -594,7 +594,6 @@ int Maat_set_feather_opt(Maat_feather_t feather,enum MAAT_INIT_OPT type,const vo
|
||||
break;
|
||||
case MAAT_OPT_STAT_ON:
|
||||
_feather->stat_on=1;
|
||||
_feather->stat_handle=FS_create_handle();
|
||||
break;
|
||||
case MAAT_OPT_PERF_ON:
|
||||
_feather->perf_on=1;
|
||||
@@ -794,7 +793,7 @@ int Maat_initiate_feather(Maat_feather_t feather)
|
||||
if(_feather->stat_on==1)
|
||||
{
|
||||
MESA_handle_runtime_log(_feather->logger,RLOG_LV_FATAL,maat_module ,
|
||||
"At initiation: MAAT_OPT_STAT_FILE_PATH not set,TURN OFF STAT trigger.");
|
||||
"At initiation: MAAT_OPT_STAT_FILE_PATH not set, TURN OFF STAT trigger.");
|
||||
}
|
||||
_feather->stat_on=0;
|
||||
}
|
||||
@@ -810,9 +809,10 @@ int Maat_initiate_feather(Maat_feather_t feather)
|
||||
"Update with cumulative version OFF.");
|
||||
}
|
||||
|
||||
|
||||
maat_stat_init(_feather);
|
||||
|
||||
if(_feather->stat_on==1)
|
||||
{
|
||||
maat_stat_init(_feather);
|
||||
}
|
||||
|
||||
pthread_create(&(_feather->cfg_mon_t), NULL, thread_rule_monitor, (void*)_feather);
|
||||
return 0;
|
||||
@@ -1699,12 +1699,6 @@ stream_para_t Maat_stream_scan_digest_start(Maat_feather_t feather,int table_id,
|
||||
_feather->scan_err_cnt++;
|
||||
return NULL;
|
||||
}
|
||||
tmp_fuzzy_handle=SFH_instance(total_len);
|
||||
if(tmp_fuzzy_handle==NULL)
|
||||
{
|
||||
_feather->scan_err_cnt++;
|
||||
return NULL;
|
||||
}
|
||||
struct _stream_para_t* sp=(struct _stream_para_t*)calloc(sizeof(struct _stream_para_t),1);
|
||||
scanner=_feather->scanner;
|
||||
sp->feather=_feather;
|
||||
@@ -1713,8 +1707,15 @@ stream_para_t Maat_stream_scan_digest_start(Maat_feather_t feather,int table_id,
|
||||
if(scanner==NULL)
|
||||
{
|
||||
return sp;
|
||||
}
|
||||
tmp_fuzzy_handle=SFH_instance(total_len);
|
||||
if(tmp_fuzzy_handle==NULL)
|
||||
{
|
||||
_feather->scan_err_cnt++;
|
||||
return NULL;
|
||||
}
|
||||
INC_SCANNER_REF(scanner, thread_num);
|
||||
|
||||
sp->table_id=table_id;
|
||||
sp->thread_num=thread_num;
|
||||
sp->total_len=total_len;
|
||||
|
||||
@@ -3549,6 +3549,7 @@ void *thread_rule_monitor(void *arg)
|
||||
MESA_htable_destroy(feather->map_tablename2id,free);
|
||||
destroy_maat_scanner(feather->scanner);
|
||||
garbage_bury(feather->garbage_q,0,feather->logger);
|
||||
assert(0==MESA_lqueue_get_count(feather->garbage_q));
|
||||
MESA_lqueue_destroy(feather->garbage_q,lqueue_destroy_cb,NULL);
|
||||
int i=0;
|
||||
for(i=0;i<MAX_TABLE_NUM;i++)
|
||||
|
||||
@@ -51,6 +51,8 @@ void maat_stat_init(struct _Maat_feather_t* feather)
|
||||
FS_set_para(feather->stat_handle, PRINT_MODE, &value, sizeof(value));
|
||||
value=0;
|
||||
FS_set_para(feather->stat_handle, CREATE_THREAD, &value, sizeof(value));
|
||||
|
||||
FS_set_para(feather->stat_handle, APP_NAME, feather->instance_name, strlen(feather->instance_name)+1);
|
||||
|
||||
feather->fs_status_id[STATUS_VERSION]=FS_register(feather->stat_handle, FS_STYLE_STATUS, FS_CALC_CURRENT,"version");
|
||||
feather->fs_status_id[STATUS_THRED_NUM]=FS_register(feather->stat_handle, FS_STYLE_STATUS, FS_CALC_CURRENT,"thread");
|
||||
|
||||
@@ -252,6 +252,7 @@ void boolexpr_destroy(void * instance)
|
||||
for(unsigned int i=0; i<matcher->max_thread_num; i++)
|
||||
{
|
||||
delete [] matcher->thread_data[i].bitmap;
|
||||
delete [] matcher->thread_data[i].matched_bitmap;
|
||||
}
|
||||
delete [] matcher->thread_data;
|
||||
delete matcher;
|
||||
|
||||
Reference in New Issue
Block a user