From 03cd548ca4d4d6733117a0ba905570ef39570e00 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 20 May 2020 21:49:14 +0800 Subject: [PATCH] clean object in ObjectStack --- .../command/monitor200/TimeTunnelAdviceListener.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelAdviceListener.java b/core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelAdviceListener.java index 9566a3dd..fcaaa040 100644 --- a/core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelAdviceListener.java +++ b/core/src/main/java/com/taobao/arthas/core/command/monitor200/TimeTunnelAdviceListener.java @@ -117,7 +117,7 @@ public class TimeTunnelAdviceListener extends AdviceListenerAdapter { * * * - * @author hengyunabc 2019-11-20 + * @author hengyunabc 2020-05-20 * */ static class ObjectStack { @@ -147,11 +147,15 @@ public class TimeTunnelAdviceListener extends AdviceListenerAdapter { public Object pop() { if (pos > 0) { pos--; - return array[pos]; + Object object = array[pos]; + array[pos] = null; + return object; } else { pos = cap; pos--; - return array[pos]; + Object object = array[pos]; + array[pos] = null; + return object; } } }