Skip to content

Commit

Permalink
potential fix for #70
Browse files Browse the repository at this point in the history
  • Loading branch information
andyedinborough committed May 2, 2012
1 parent 5491678 commit 775bfa6
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions TextClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,22 +128,20 @@ public void Disconnect() {
}

public void Dispose() {
Dispose(true);
GC.SuppressFinalize(this);
}

public virtual void Dispose(bool disposing) {
if (disposing) {
if (IsDisposed) return;
lock (this) {
if (IsDisposed) return;
IsDisposed = true;
Disconnect();

try {
OnDispose();
} catch (Exception) { }

IsDisposed = true;
_Stream = null;
_Connection = null;
}
GC.SuppressFinalize(this);
}
}
}

0 comments on commit 775bfa6

Please sign in to comment.