diff options
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/Ice/ConnectionI.cs | 8 | ||||
-rw-r--r-- | csharp/src/Ice/WSTransceiver.cs | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/csharp/src/Ice/ConnectionI.cs b/csharp/src/Ice/ConnectionI.cs index ba6729d48ba..56efa21ec1a 100644 --- a/csharp/src/Ice/ConnectionI.cs +++ b/csharp/src/Ice/ConnectionI.cs @@ -1444,6 +1444,14 @@ namespace Ice } _asyncRequests.Clear(); + // + // Don't wait to be reaped to reclaim memory allocated by read/write streams. + // + _writeStream.clear(); + _writeStream.getBuffer().clear(); + _readStream.clear(); + _readStream.getBuffer().clear(); + if(_callback != null) { try diff --git a/csharp/src/Ice/WSTransceiver.cs b/csharp/src/Ice/WSTransceiver.cs index 09249d663da..b758e44dc7c 100644 --- a/csharp/src/Ice/WSTransceiver.cs +++ b/csharp/src/Ice/WSTransceiver.cs @@ -314,6 +314,12 @@ namespace IceInternal { _delegate.close(); _state = StateClosed; + + // + // Clear the buffers now instead of waiting for destruction. + // + _readBuffer.clear(); + _writeBuffer.clear(); } public EndpointI bind() @@ -1240,7 +1246,7 @@ namespace IceInternal n = _readPayloadLength; } if(n > 0) - { + { System.Buffer.BlockCopy(_readBuffer.b.rawBytes(), _readBufferPos, buf.b.rawBytes(), buf.b.position(), n); buf.b.position(buf.b.position() + n); |