Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for JRUBY-4832: Memory Leak when extending Java class with additi…

…onal Ruby instance variable
  • Loading branch information...
commit 712cd8f8dc48f060d8048f2f6cec1e8cabf7c0ff 1 parent 9247969
Charles Oliver Nutter headius authored
Showing with 11 additions and 9 deletions.
  1. +11 −9 src/org/jruby/java/proxies/ConcreteJavaProxy.java
20 src/org/jruby/java/proxies/ConcreteJavaProxy.java
View
@@ -159,15 +159,17 @@ public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule claz
return concreteJavaProxy;
}
- @Override
- public Object getVariable(int index) {
- return getRuntime().getJavaSupport().getJavaObjectVariable(this, index);
- }
-
- @Override
- public void setVariable(int index, Object value) {
- getRuntime().getJavaSupport().setJavaObjectVariable(this, index, value);
- }
+ // This alternate ivar logic is disabled because it can cause self-referencing
+ // chains to keep the original object alive. See JRUBY-4832.
+// @Override
+// public Object getVariable(int index) {
+// return getRuntime().getJavaSupport().getJavaObjectVariable(this, index);
+// }
+//
+// @Override
+// public void setVariable(int index, Object value) {
+// getRuntime().getJavaSupport().setJavaObjectVariable(this, index, value);
+// }
/**
* Because we can't physically associate an ID with a Java object, we can
Please sign in to comment.
Something went wrong with that request. Please try again.