dev@grizzly.java.net

buffer dispose question

From: Tigran Mkrtchyan <tigran.mkrtchyan_at_desy.de>
Date: Thu, 22 Mar 2012 15:43:56 +0100

Hi,

I have a following code:

Buffer buffer1 = ...;
Buffer buffer2 = ...;

 Buffer composite = BuffersBuffer.create(MemoryManager.DEFAULT_MEMORY_MANAGER,
                buffer1, buffer2 );
 composite.allowBufferDispose(true);

At this point I expect that

composite.tryDispose() and composite.dispose() will dispose buffer1 and buffer2.

Nevertheless this is not the case. I think

composite.allowBufferDispose(true);

have to propagate to buffer1 and buffer2 or

BuffersBuffer.removeAndDisposeBuffers have to call dispose on
underlying buffers instead of tryDispose.

Tigran.