diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-05-30 11:46:11 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-05-30 11:46:11 +0200 |
commit | 1cd21cd113fd7b4b3567d6fb02ebe1a99c2b43fc (patch) | |
tree | 12ba967bfcf44a787c7d989b0869679123957394 | |
parent | ICE-6955 - refcount bug in Python blobject API (diff) | |
download | ice-1cd21cd113fd7b4b3567d6fb02ebe1a99c2b43fc.tar.bz2 ice-1cd21cd113fd7b4b3567d6fb02ebe1a99c2b43fc.tar.xz ice-1cd21cd113fd7b4b3567d6fb02ebe1a99c2b43fc.zip |
Fixed ICE-6868 - C# fix to release memory held by transports sooner
-rw-r--r-- | cs/src/Ice/ConnectionI.cs | 9 | ||||
-rw-r--r-- | cs/src/Ice/TcpTransceiver.cs | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/cs/src/Ice/ConnectionI.cs b/cs/src/Ice/ConnectionI.cs index 8b1facc56e0..1e033a751a4 100644 --- a/cs/src/Ice/ConnectionI.cs +++ b/cs/src/Ice/ConnectionI.cs @@ -1648,6 +1648,15 @@ 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(); + _incomingCache = null; + + // // This must be done last as this will cause waitUntilFinished() to return (and communicator // objects such as the timer might be destroyed too). // diff --git a/cs/src/Ice/TcpTransceiver.cs b/cs/src/Ice/TcpTransceiver.cs index cdaf182f9ac..9a5a5629075 100644 --- a/cs/src/Ice/TcpTransceiver.cs +++ b/cs/src/Ice/TcpTransceiver.cs @@ -358,6 +358,7 @@ namespace IceInternal throw new SocketException((int)_readEventArgs.SocketError); } int ret = _readEventArgs.BytesTransferred; + _readEventArgs.SetBuffer(null, 0, 0); #else int ret = _fd.EndReceive(_readResult); _readResult = null; @@ -521,6 +522,7 @@ namespace IceInternal throw new SocketException((int)_writeEventArgs.SocketError); } int ret = _writeEventArgs.BytesTransferred; + _writeEventArgs.SetBuffer(null, 0, 0); #else int ret = _fd.EndSend(_writeResult); _writeResult = null; |