[BF] Catch Exception on shutdown

This commit is contained in:
BlubbFish 2017-12-17 20:00:13 +00:00
parent 400ee555e7
commit 7ba4d9192d
7 changed files with 5 additions and 4 deletions

View File

@ -42,10 +42,11 @@ namespace BlubbFish.Utils.IoT.Connector.Data {
protected virtual void Dispose(Boolean disposing) {
if(!this.disposedValue) {
if(disposing) {
this.client.MqttMsgPublishReceived -= this.Client_MqttMsgPublishReceived;
this.client.Unsubscribe(new String[] { "#" });
this.client.Disconnect();
if(disposing) {try {
this.client.MqttMsgPublishReceived -= this.Client_MqttMsgPublishReceived;
this.client.Unsubscribe(new String[] { "#" });
this.client.Disconnect();
} catch (Exception) { }
}
this.client = null;

Binary file not shown.

Binary file not shown.