Here's a simple tweak that clears out references to objects that are removed
from the pool.  The current code can delay garbage collection for objects
that are removed from the pool but not returned.

The diff is against 3.3-rc1

-David

--- SimplePool.java.orig        Thu Oct  4 10:14:51 2001
+++ SimplePool.java     Thu Oct  4 10:54:08 2001
@@ -132,6 +132,7 @@
        synchronized( lock ) {
            if( current >= 0 ) {
                item = pool[current];
+               pool[current] = null;
                current -= 1;
            }
            if( debug > 0 ) 

Reply via email to