Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2007-11-29 16:35:09 -0500
committerpelder2007-11-29 16:35:09 -0500
commit1fa49e242c1f8fc735b342ffca644ab0821d688d (patch)
tree279b9fcc6e8105eef889567bde156687896bf97b
parentb5802d0a5cea5fe8f5cf9b66424b30d992364ab8 (diff)
downloadorg.eclipse.jet-1fa49e242c1f8fc735b342ffca644ab0821d688d.tar.gz
org.eclipse.jet-1fa49e242c1f8fc735b342ffca644ab0821d688d.tar.xz
org.eclipse.jet-1fa49e242c1f8fc735b342ffca644ab0821d688d.zip
[211500] Leak: XPath function instances hold references to JET2Context
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java
index 055318f..802d5f7 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/internal/xpath/ast/Function.java
@@ -70,7 +70,19 @@ public class Function extends ExprNode
ExprNode expr = (ExprNode)i.next();
functionArgValues.add(expr.evalAsObject(context));
}
- return function.evaluate(functionArgValues);
+ try
+ {
+ final Object result = function.evaluate(functionArgValues);
+ return result;
+ }
+ finally
+ {
+ // ensure that cached function implementation doesn't hang on to context.
+ if (requiresContext)
+ {
+ ((XPathFunctionWithContext)function).setContext(null);
+ }
+ }
}
public String toString()

Back to the top