Clear the ThreadLocal after finishing with a method to keep from hanging onto the Stack and thereby

the Stack's classloader from that thread



git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6024 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Charlie Groves
2010-01-28 23:12:27 +00:00
parent d8b59b64c9
commit 1420b06d3b
@@ -158,6 +158,11 @@ public class MethodProfiler
long elapsed = nanos - method.entryTime;
recordTime(method.fullName(), (double)elapsed / 1000000);
method.name = null;
// Clear the ThreadLocal after we've profiled our whole stack to prevent our class loader
// from hanging around
if (_stack.get().size() == 0) {
_stack.remove();
}
}
/**