From 9ad77d1c069601aeb5c52b7c3b27e8303f48f965 Mon Sep 17 00:00:00 2001 From: Ewetumo Alexander Date: Sun, 23 Dec 2018 19:15:52 +0800 Subject: [PATCH] Ensure release of entry new encoder --- logger.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/logger.go b/logger.go index e35eeb3..bd2040b 100644 --- a/logger.go +++ b/logger.go @@ -572,6 +572,8 @@ func (l *Logger) finalizeIfContext(entry Entry) { // create a new encoder for the final output. entryEnc := gojay.BorrowEncoder(l.w) + defer entryEnc.Release() + entry.enc = entryEnc // create dummy entry for applying hooks.