[vlc-commits] logger: make the logger a new object type

Rémi Denis-Courmont git at videolan.org
Sun Feb 8 13:57:20 CET 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb  7 23:00:55 2015 +0200| [add015beb93e65ac290bf3c5275226d27885b00d] | committer: Rémi Denis-Courmont

logger: make the logger a new object type

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=add015beb93e65ac290bf3c5275226d27885b00d
---

 src/misc/messages.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/misc/messages.c b/src/misc/messages.c
index dc3f615..4566610 100644
--- a/src/misc/messages.c
+++ b/src/misc/messages.c
@@ -48,6 +48,7 @@
 
 struct vlc_logger_t
 {
+    VLC_COMMON_MEMBERS
     vlc_rwlock_t lock;
     vlc_log_cb log;
     void *sys;
@@ -389,7 +390,7 @@ static void vlc_vaLogDiscard(void *d, int type, const vlc_log_t *item,
  */
 int vlc_LogPreinit(libvlc_int_t *vlc)
 {
-    vlc_logger_t *logger = malloc(sizeof (*logger));
+    vlc_logger_t *logger = vlc_custom_create(vlc, sizeof (*logger), "logger");
 
     libvlc_priv(vlc)->logger = logger;
 
@@ -502,5 +503,5 @@ void vlc_LogDeinit(libvlc_int_t *vlc)
     }
 
     vlc_rwlock_destroy(&logger->lock);
-    free(logger);
+    vlc_object_release(logger);
 }



More information about the vlc-commits mailing list