mirror of
https://salsa.debian.org/ha-team/libqb
synced 2026-08-19 02:47:40 +00:00
LOG: clean up mem better when qb_log_fini is called
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
This commit is contained in:
parent
b2a0c06d50
commit
fdf418abf5
@ -707,10 +707,8 @@ qb_log_fini(void)
|
||||
|
||||
for (pos = 0; pos <= conf_active_max; pos++) {
|
||||
t = &conf[pos];
|
||||
if (t->state != QB_LOG_STATE_ENABLED) {
|
||||
continue;
|
||||
}
|
||||
_log_target_disable(t);
|
||||
free(conf[pos].format);
|
||||
qb_list_for_each_safe(iter2, next2, &t->filter_head) {
|
||||
flt = qb_list_entry(iter2, struct qb_log_filter, list);
|
||||
qb_list_del(iter2);
|
||||
@ -765,10 +763,6 @@ qb_log_target_get(int32_t pos)
|
||||
void *
|
||||
qb_log_target_user_data_get(int32_t t)
|
||||
{
|
||||
if (!logger_inited) {
|
||||
errno = -EINVAL;
|
||||
return NULL;
|
||||
}
|
||||
if (t < 0 || t >= QB_LOG_TARGET_MAX ||
|
||||
conf[t].state == QB_LOG_STATE_UNUSED) {
|
||||
errno = -EBADF;
|
||||
|
||||
@ -181,4 +181,7 @@ qb_log_dcs_init(void)
|
||||
void
|
||||
qb_log_dcs_fini(void)
|
||||
{
|
||||
qb_array_free(lookup_arr);
|
||||
qb_array_free(callsite_arr);
|
||||
(void)qb_thread_lock_destroy(arr_next_lock);
|
||||
}
|
||||
|
||||
@ -273,4 +273,5 @@ qb_log_thread_stop(void)
|
||||
sem_post(&logt_print_finished);
|
||||
pthread_join(logt_thread_id, NULL);
|
||||
}
|
||||
(void)qb_thread_lock_destroy(logt_wthread_lock);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user