From 3f01cddfc4678cd32dcab0cf776025e5c1ccef9b Mon Sep 17 00:00:00 2001 From: darklore Date: Wed, 5 Feb 2020 18:27:15 +0900 Subject: [PATCH] Fix memory leak when Broker.Open and Broker.Close called repeatedly --- broker.go | 1 + 1 file changed, 1 insertion(+) diff --git a/broker.go b/broker.go index d27ebd22d..9ca41c91e 100644 --- a/broker.go +++ b/broker.go @@ -1367,6 +1367,7 @@ func (b *Broker) unregisterMetrics() { for _, name := range b.registeredMetrics { b.conf.MetricRegistry.Unregister(name) } + b.registeredMetrics = nil } func (b *Broker) registerMeter(name string) metrics.Meter {