From d3ff2d6b62b095f37582affe84e267d7e5be88c6 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Fri, 4 Dec 2020 15:36:21 -0800 Subject: device: clear pointers when returning elems to pools Signed-off-by: Josh Bleecher Snyder --- device/pools.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'device/pools.go') diff --git a/device/pools.go b/device/pools.go index e778d2e..6939eeb 100644 --- a/device/pools.go +++ b/device/pools.go @@ -65,6 +65,7 @@ func (device *Device) GetInboundElement() *QueueInboundElement { } func (device *Device) PutInboundElement(msg *QueueInboundElement) { + msg.clearPointers() if PreallocatedBuffersPerPool == 0 { device.pool.inboundElementPool.Put(msg) } else { @@ -81,6 +82,7 @@ func (device *Device) GetOutboundElement() *QueueOutboundElement { } func (device *Device) PutOutboundElement(msg *QueueOutboundElement) { + msg.clearPointers() if PreallocatedBuffersPerPool == 0 { device.pool.outboundElementPool.Put(msg) } else { -- cgit v1.2.3-59-g8ed1b