Browse files

cleaned up some of the disposal code in hopes of correcting issue #40

…once and for all
  • Loading branch information...
1 parent b6b4d57 commit ee3337164dadc85dc98bb1aa8606dc5942476ae0 @nberardi nberardi committed Jun 20, 2012
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/Connections/Connection.cs
View
11 src/Connections/Connection.cs
@@ -175,10 +175,15 @@ public void Dispose()
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
protected virtual void Dispose(bool disposing)
{
- if (WasDisposed)
- return;
+ if (!WasDisposed && disposing && _transport != null)
+ {
+ Close();
+
+ _client = null;
+ _protocol = null;
+ _transport = null;
+ }
- Close();
WasDisposed = true;
}

0 comments on commit ee33371

Please sign in to comment.