Return-Path: Delivered-To: apmail-xml-xalan-cvs-archive@xml.apache.org Received: (qmail 28810 invoked by uid 500); 5 Sep 2001 18:52:11 -0000 Mailing-List: contact xalan-cvs-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: Delivered-To: mailing list xalan-cvs@xml.apache.org Received: (qmail 28791 invoked from network); 5 Sep 2001 18:52:11 -0000 Date: 5 Sep 2001 18:49:33 -0000 Message-ID: <20010905184933.24741.qmail@icarus.apache.org> From: tmiller@apache.org To: xml-xalan-cvs@apache.org Subject: cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/runtime AbstractTranslet.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N tmiller 01/09/05 11:49:33 Modified: java/src/org/apache/xalan/xsltc/runtime AbstractTranslet.java Log: bug fix # 3424, memory retension fixed, John Howard contributed fix. Revision Changes Path 1.22 +20 -2 xml-xalan/java/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java Index: AbstractTranslet.java =================================================================== RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/AbstractTranslet.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- AbstractTranslet.java 2001/08/27 12:38:32 1.21 +++ AbstractTranslet.java 2001/09/05 18:49:33 1.22 @@ -1,5 +1,5 @@ /* - * @(#)$Id: AbstractTranslet.java,v 1.21 2001/08/27 12:38:32 morten Exp $ + * @(#)$Id: AbstractTranslet.java,v 1.22 2001/09/05 18:49:33 tmiller Exp $ * * The Apache Software License, Version 1.1 * @@ -60,6 +60,7 @@ * @author Santiago Pericas-Geertsen * @author Morten Jorgensen * @author G. Todd Miller + * @author John Howard, JohnH@schemasoft.com */ package org.apache.xalan.xsltc.runtime; @@ -144,8 +145,16 @@ */ public final void popParamFrame() { if (pbase > 0) { + int bot = pbase - 1; + int top = pframe - 1; pframe = pbase - 1; pbase = ((Integer) paramsStack.elementAt(pframe)).intValue(); + // bug fix #3424, John Howard. + // remove objects that are in the stack since objects are + // added with insertElementAt(int) and will cause memory retention + for (int i=top; i>=bot; i--){ + paramsStack.removeElementAt(i); + } } } @@ -219,8 +228,16 @@ */ public final void popVarFrame() { if (vbase > 0) { + int bot = vbase - 1; + int top = vframe - 1; vframe = vbase - 1; vbase = ((Integer)varsStack.elementAt(vframe)).intValue(); + // bug fix 3424, John Howard + // remove objects that are in the stack since objects are + // added with insertElementAt(int) and will cause memory retention + for (int i=top; i>=bot; i--){ + varsStack.removeElementAt(i); + } } } @@ -228,9 +245,10 @@ * Get the value of a variable given its index. */ public final Object getVariable(int vindex) { - Object blob = varsStack.elementAt(vbase + vindex); + // bug fix 3424, John Howard return varsStack.elementAt(vbase + vindex); } + /** * Set the value of a variable in the current frame. --------------------------------------------------------------------- To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org For additional commands, e-mail: xalan-cvs-help@xml.apache.org