Skip to content
Browse files

NCBC-136: NRE thrown when disposing disabled Heartbeat

Change-Id: Ia7ad8562f23b294f6649892baad56e2f7c50e9cc
Reviewed-on: http://review.couchbase.org/22232
Reviewed-by: Matt Ingenthron <matt@couchbase.com>
Tested-by: John C. Zablocki <john@couchbase.com>
  • Loading branch information...
1 parent 51aba51 commit 16f58431bfabe8d926a17201c8707c378965d174 @johnzablocki johnzablocki committed with John C. Zablocki Nov 2, 2012
Showing with 9 additions and 3 deletions.
  1. +9 −3 src/Couchbase/MessageStreamListener.cs
View
12 src/Couchbase/MessageStreamListener.cs
@@ -509,7 +509,10 @@ void IDisposable.Dispose()
Interlocked.Exchange(ref this.shouldAbort, 2);
- this.timer.Change(Timeout.Infinite, Timeout.Infinite);
+ if (timer != null)
+ {
+ this.timer.Change(Timeout.Infinite, Timeout.Infinite);
+ }
if (this.request != null)
{
@@ -525,8 +528,11 @@ void IDisposable.Dispose()
this.response = null;
}
- this.timer.Dispose();
- this.timer = null;
+ if (timer != null)
+ {
+ this.timer.Dispose();
+ this.timer = null;
+ }
}
private void Worker(object state)

0 comments on commit 16f5843

Please sign in to comment.
Something went wrong with that request. Please try again.