From ed4a89082bb29b9e7d869c5d25d6b9ea8fc9d25b Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Wed, 27 May 2015 16:56:05 +0200 Subject: [PATCH] Fix regression introduced by f765053ae740e300a6b696840d7dfe5de32afeb3 by use Entry after it is recycled --- buffer/src/main/java/io/netty/buffer/PoolThreadCache.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java b/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java index 3b92a47afb..3792c3e65a 100644 --- a/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java +++ b/buffer/src/main/java/io/netty/buffer/PoolThreadCache.java @@ -441,11 +441,12 @@ final class PoolThreadCache { @SuppressWarnings({ "unchecked", "rawtypes" }) private void freeEntry(Entry entry) { PoolChunk chunk = entry.chunk; + long handle = entry.handle; // recycle now so PoolChunk can be GC'ed. entry.recycle(); - chunk.arena.freeChunk(chunk, entry.handle, sizeClass); + chunk.arena.freeChunk(chunk, handle, sizeClass); } static final class Entry {