private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (m_portfolio != null)
         {
             m_portfolio.Dispose();
             m_portfolio = null;
         }
         if (m_indices != null)
         {
             m_indices.Dispose();
             m_indices = null;
         }
         if (m_messageUtilities1 != null)
         {
             m_messageUtilities1.Dispose();
             m_messageUtilities1 = null;
         }
         if (m_messageUtilities2 != null)
         {
             m_messageUtilities2.Dispose();
             m_messageUtilities2 = null;
         }
         PositionMonitorUtilities.Info(Name + " disposed");
     }
 }
Exemplo n.º 2
0
        protected void Dispose(bool disposing)
        {
            if (m_bWaiting)
            {
                m_waitHandle.Set();
                System.Threading.Thread.Sleep(m_parms.Timeout * 2);
            }

            if (m_bTaskStarted)
            {
                m_bTaskStarted = !EndTask(m_parms.TaskName, !m_bTaskFailed);
            }

            if (disposing)
            {
                if (m_waitHandle != null)
                {
                    m_waitHandle.Dispose();
                    m_waitHandle = null;
                }
                if (QuoteReader != null)
                {
                    QuoteReader.Dispose();
                    QuoteReader = null;
                }

                if (m_hugoConnection != null)
                {
                    m_hugoConnection.Dispose();
                    m_hugoConnection = null;
                }

                if (m_writer != null)
                {
                    m_writer.Dispose();
                    m_writer = null;
                }
            }
        }