Skip to content
Snippets Groups Projects
Commit eca2d51b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont Committed by Jean-Baptiste Kempf
Browse files

messages: set the "discard" logger when exiting

Normally closing a logger should not incur new log messages, but...
the early logger does exactly that, and this prevents it from looping
infinitely into itself. This situation occurs if no proper logger was
installed until the log switch was destroyed.

Fixes #26363.

This effectively reverts
commit e8700cbd.
parent abf527b5
No related branches found
No related tags found
1 merge request!1022messages: set the "discard" logger when exiting
Pipeline #168742 passed with stages
in 38 minutes and 1 second
......@@ -322,15 +322,16 @@ static void vlc_vaLogSwitch(void *d, int type, const vlc_log_t *item,
vlc_rcu_read_unlock();
}
static void vlc_LogSwitch(vlc_logger_t *logger, vlc_logger_t *new_logger);
static void vlc_LogSwitchClose(void *d)
{
struct vlc_logger *logger = d;
struct vlc_logger_switch *logswitch =
container_of(logger, struct vlc_logger_switch, frontend);
struct vlc_logger *backend = atomic_load_explicit(&logswitch->backend,
memory_order_relaxed);
backend->ops->destroy(backend);
/* Discard any further messages. */
vlc_LogSwitch(logger, &discard_log);
free(logswitch);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment