Example #1
0
 /// <summary>
 /// Disposes of or finalises the object.
 /// </summary>
 /// <param name="disposing"></param>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (!Disposed)
         {
             if (_PrivateHeartbeat != null)
             {
                 _PrivateHeartbeat.FastTick -= Heartbeat_FastTimerTicked;
                 _PrivateHeartbeat.SlowTick -= Heartbeat_SlowTimerTicked;
                 _PrivateHeartbeat.Dispose();
             }
             Disposed = true;
         }
     }
 }
Example #2
0
 /// <summary>
 /// See interface docs.
 /// </summary>
 public void Shutdown()
 {
     if (_OnlineLookupCache != null)
     {
         _OnlineLookupCache.Enabled = false;
     }
     if (_BackgroundThreadMessageQueue != null)
     {
         _BackgroundThreadMessageQueue.Dispose();
     }
     if (_HeartbeatService != null)
     {
         _HeartbeatService.SlowTick -= Heartbeat_SlowTick;
         _HeartbeatService.Dispose();
     }
     EndSession();
 }
Example #3
0
        public void Dispose()
        {
            foreach (var disposable in _handlers)
            {
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
            _handlers.Clear();

            if (_heartbeatService != null)
            {
                _heartbeatService.Stop();
                _heartbeatService.Dispose();
                _heartbeatService = null;
            }

            _bus = null;
            _eventProcessingBus = null;
        }
Example #4
0
 public void Dispose()
 {
     gateway.Dispose();
     voiceClient.Dispose();
     heartbeatService.Dispose();
 }
Example #5
0
 public void Dispose()
 {
     voiceGateway.Dispose();
     heartbeatService.Dispose();
     udpClient.Dispose();
 }