Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FXCop - Fixed the Disposable implementation in the MessageBus

  • Loading branch information...
commit 8ecc2ccebc84286f4a4c591c614a58aa8097aec5 1 parent e17790c
@NTaylorMullen NTaylorMullen authored
View
2  src/Microsoft.AspNet.SignalR.Core/MessageBus/MessageBus.cs
@@ -303,7 +303,7 @@ protected virtual void Dispose(bool disposing)
}
}
- public virtual void Dispose()
+ public void Dispose()
{
Dispose(true);
}
View
21 src/Microsoft.AspNet.SignalR.Redis/RedisMessageBus.cs
@@ -111,20 +111,23 @@ private void OnMessage(string key, byte[] data)
_publishQueue.Enqueue(() => OnReceived(key, (ulong)message.Id, message.Messages));
}
- public override void Dispose()
+ protected override void Dispose(bool disposing)
{
- if (_channel != null)
+ if (disposing)
{
- _channel.Unsubscribe(_keys);
- _channel.Close(abort: true);
- }
+ if (_channel != null)
+ {
+ _channel.Unsubscribe(_keys);
+ _channel.Close(abort: true);
+ }
- if (_connection != null)
- {
- _connection.Close(abort: true);
+ if (_connection != null)
+ {
+ _connection.Close(abort: true);
+ }
}
- base.Dispose();
+ base.Dispose(disposing);
}
}
}
View
10 src/Microsoft.AspNet.SignalR.SqlServer/SqlMessageBus.cs
@@ -32,10 +32,14 @@ protected override Task Send(Message[] messages)
return _sender.Send(messages);
}
- public override void Dispose()
+ protected override void Dispose(bool disposing)
{
- _receiver.Dispose();
- base.Dispose();
+ if (disposing)
+ {
+ _receiver.Dispose();
+ }
+
+ base.Dispose(disposing);
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.