public
Created

  • Download Gist
gistfile1.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
diff --git a/src/org/jruby/Ruby.java b/src/org/jruby/Ruby.java
index 35def50..84ef7f3 100644
--- a/src/org/jruby/Ruby.java
+++ b/src/org/jruby/Ruby.java
@@ -2883,6 +2883,14 @@ public final class Ruby {
public void tearDown(boolean systemExit) {
int status = 0;
+ // clear out threadlocals so they don't leak
+ recursive = new ThreadLocal<Map<String, RubyHash>>();
+ recursiveKey = new ThreadLocal<RubySymbol>() {
+ protected RubySymbol initialValue() {
+ return newSymbol("__recursive_key__");
+ }
+ };
+
while (!atExitBlocks.empty()) {
RubyProc proc = atExitBlocks.pop();
try {

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.