Created
May 8, 2012 22:04
-
-
Save headius/2639787 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment