[vlc-commits] [Git][videolan/vlc][master] messages: set the "discard" logger when exiting

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Dec 13 12:38:03 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
eca2d51b by RĂ©mi Denis-Courmont at 2021-12-13T12:20:52+00:00
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 e8700cbde5435adfacac978d6e8e4c2595b558a3.

- - - - -


1 changed file:

- src/misc/messages.c


Changes:

=====================================
src/misc/messages.c
=====================================
@@ -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);
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/eca2d51b6be0bdfe56b5da436d3e9084d97371b1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/eca2d51b6be0bdfe56b5da436d3e9084d97371b1
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list