protected virtual void Dispose(bool disposing) { if (!disposed) { if (disposing) { // Shutdown the Dispatcher if (disp != null) { disp.BeginInvokeShutdown(); disp = null; } // Shutdown the TTAPI if (UniversalApiInstance != null) { UniversalApiInstance.Shutdown(); UniversalApiInstance = null; } else if (XTraderApiInstance != null) { XTraderApiInstance.Shutdown(); XTraderApiInstance = null; } } } disposed = true; }
}//Dispose() protected virtual void Dispose(bool disposing) { lock (m_DisposeLock) { if (!m_IsDisposed) { if (disposing) { if (m_Log != null) { m_Log.RequestStop(); m_Log = null; } if (m_Dispatcher != null) { m_Dispatcher.BeginInvokeShutdown(); m_Dispatcher = null; } if (m_UAPI != null) { m_UAPI.Shutdown(); m_UAPI = null; } if (m_XAPI != null) { m_XAPI.Shutdown(); m_XAPI = null; } } } m_IsDisposed = true; OnStopping(); } }//Dispose()