Existing unused loggers are leaked when there is a change
in logging configuration. Added a check to free the loggers
that are not used after tools.conf is modified.
/* If needed, restore the old configuration. */
if (!reset) {
if (oldDomains != NULL) {
+ guint i;
+ for (i = 0; i < oldDomains->len; i++) {
+ LogHandler *old = g_ptr_array_index(oldDomains, i);
+ CLEAR_LOG_HANDLER(old);
+ }
g_ptr_array_free(oldDomains, TRUE);
}
+ if (oldDefault != NULL && oldDefault != gDefaultData) {
+ CLEAR_LOG_HANDLER(oldDefault);
+ oldDefault = NULL;
+ }
}
/*