Ejemplo n.º 1
0
        public void Dispose()
        {
            if (_timer != null)
            {
                _timer.Cancel();

                var localObj = Interlocked.Exchange(ref _timer, null);
                if (localObj != null)
                {
                    Marshal.ReleaseComObject(localObj);
                }
            }
        }
Ejemplo n.º 2
0
        public void Dispose()
        {
            if (_timer != null)
            {
                _timer.Cancel();

                var localObj = Interlocked.Exchange(ref _timer, null);
                if (localObj != null)
                {
                    Marshal.ReleaseComObject(localObj);
                }

                _timer = null;
            }
            GC.SuppressFinalize(this);
        }