directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r151510 - incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
Date Sat, 05 Feb 2005 16:35:45 GMT
Author: trustin
Date: Sat Feb  5 08:35:44 2005
New Revision: 151510

URL: http://svn.apache.org/viewcvs?view=rev&rev=151510
Log:
Fixed: DIRMINA-6: Filtered ByteBuffer is not released automatically.

Modified:
    incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java

Modified: incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
URL: http://svn.apache.org/viewcvs/incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java?view=diff&r1=151509&r2=151510
==============================================================================
--- incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
(original)
+++ incubator/directory/network/trunk/mina/src/java/org/apache/mina/util/IoHandlerFilterManager.java
Sat Feb  5 08:35:44 2005
@@ -244,9 +244,17 @@
                       Object marker )
     {
         Entry e = tail;
+        ByteBuffer newBuf;
         do
         {
-            buf = e.filter.filterWrite( session, buf );
+            newBuf = e.filter.filterWrite( session, buf );
+            if( buf != newBuf )
+            {
+            	// Original buffer is replaced with new filtered buffer;
+            	// let's release the old one.
+            	ByteBuffer.release(buf);
+            }
+            buf = newBuf;
             e = e.prevEntry;
         }
         while( e != null );



Mime
View raw message