DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31585>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31585

Minor Memory Leak in Iterator Tag





------- Additional Comments From [EMAIL PROTECTED]  2004-10-07 19:59 -------
OTTOMH, something like this:

protected Reference collectionRef = null;
protected Object collection = null;

private Object getCollectionFromRef() {
    return ((this.collectionRef == null) ? null : this.collectionRef.get());
}

public Object getCollection() {
    return getCollectionFromRef();
}

public void setCollection(Object collection) {
    this.collection = null;
    this.collectionRef = ((collection == null) ? null : new
WeakReference(collection));
}

public int doStartTag() throws JspException {
    ...
    // create a strong reference during tag processing
    this.collection = getCollectionFromRef();
    ...
}

public int doEndTag() throws JspException {
    ...
    // remove strong reference
    this.collection = null;
    ...
}

public void release() {
    ...
    this.collectionRef = null;
    ...
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to