diff --git a/src/tlog.c b/src/tlog.c index 8c9e816..7162fb1 100644 --- a/src/tlog.c +++ b/src/tlog.c @@ -1,6 +1,6 @@ /* * tinylog - * Copyright (C) 2018-2019 Nick Peng + * Copyright (C) 2018-2020 Nick Peng * https://github.com/pymumu/tinylog */ #ifndef _GNU_SOURCE diff --git a/src/tlog.h b/src/tlog.h index 35d0794..507f629 100644 --- a/src/tlog.h +++ b/src/tlog.h @@ -1,6 +1,6 @@ /* * tinylog - * Copyright (C) 2018-2019 Ruilin Peng (Nick) + * Copyright (C) 2018-2020 Ruilin Peng (Nick) * https://github.com/pymumu/tinylog */ @@ -196,6 +196,7 @@ public: Buffer LogStream(tlog_level level, const char *file, int line, const char *func, void *userptr) { return Buffer(new Stream, [=](Stream *st) { tlog_ext(level, file, line, func, userptr, "%s", st->str().c_str()); + delete st; }); } }; @@ -215,6 +216,7 @@ public: Buffer Out(tlog_log *log) { return Buffer(new Stream, [=](Stream *st) { tlog_printf(log, "%s", st->str().c_str()); + delete st; }); } };