You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by tm...@apache.org on 2001/09/05 20:49:33 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/runtime AbstractTranslet.java

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