Created
March 9, 2010 12:50
-
-
Save vvs/326539 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/util/ReferenceReaper.java b/src/org/jruby/util/ReferenceReaper.java | |
index 78e3e54..2092d47 100644 | |
--- a/src/org/jruby/util/ReferenceReaper.java | |
+++ b/src/org/jruby/util/ReferenceReaper.java | |
@@ -48,8 +48,12 @@ public final class ReferenceReaper { | |
for ( ; ; ) { | |
try { | |
Reference r = referenceQueue.remove(); | |
- if (r instanceof Runnable) { | |
- ((Runnable) r).run(); | |
+ try { | |
+ if (r instanceof Runnable) { | |
+ ((Runnable) r).run(); | |
+ } | |
+ } finally { | |
+ r.clear(); | |
} | |
} catch (InterruptedException ex) { | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment