File tree 2 files changed +5
-5
lines changed
2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,10 @@ internal async Task CancelBackgroundTasksAsync()
197
197
/// </summary>
198
198
public void Dispose ( )
199
199
{
200
+ // Dispose managed resources.
201
+ this . cancellationTokenSource . Cancel ( ) ;
202
+ this . cancellationTokenSource . Dispose ( ) ;
203
+
200
204
this . Dispose ( ) ;
201
205
/*
202
206
This object will be cleaned up by the Dispose method.
Original file line number Diff line number Diff line change @@ -173,11 +173,7 @@ protected virtual void Dispose(bool disposing)
173
173
Logger . Trace ( "HiveMQClient Dispose: Disconnecting connected client." ) ;
174
174
_ = Task . Run ( async ( ) => await this . DisconnectAsync ( ) . ConfigureAwait ( false ) ) ;
175
175
}
176
-
177
- // Dispose managed resources.
178
- // this.cancellationTokenSource.Cancel();
179
- // this.cancellationTokenSource.Dispose();
180
- }
176
+ }
181
177
182
178
// Call the appropriate methods to clean up
183
179
// unmanaged resources here.
You can’t perform that action at this time.
0 commit comments