Ejemplo n.º 1
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    try {
                    } finally {
                        comunicator.OnRequest -= onServerRequest;
                        comunicator?.Dispose();

                        if (event55Wtch?.Dependancy != null)
                        {
                            event55Wtch.Dependancy.OnChanged       -= onChangedEvent55EventHandler;
                            event55Wtch.Dependancy.OnStatusChanged -= onStatusChanged;
                            event55Wtch.Dependancy.OnError         -= onError;
                            event55Wtch.Dispose();
                            event55Wtch = null;
                        }

                        eventService?.Dispose();
                        eventService = null;
                        onChangedEvent55EventHandler = null;
                    }
                }
                Log.Trace($"Disposed: {ToString()}");
                disposedValue = true;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Shut down the Academy.
        /// </summary>
        public void Dispose()
        {
            DisableAutomaticStepping();
            // Signal to listeners that the academy is being destroyed now
            DestroyAction?.Invoke();

            Communicator?.Dispose();
            Communicator = null;

            if (m_ModelRunners != null)
            {
                foreach (var mr in m_ModelRunners)
                {
                    mr.Dispose();
                }
                m_ModelRunners = null;
            }

            // Clear out the actions so we're not keeping references to any old objects
            ResetActions();

            // TODO - Pass worker ID or some other identifier,
            // so that multiple envs won't overwrite each others stats.
            TimerStack.Instance.SaveJsonTimers();

            FloatProperties = null;
            m_Initialized   = false;

            // Reset the Lazy instance
            s_Lazy = new Lazy <Academy>(() => new Academy());
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Disposes the Client, you should close Session before
 /// </summary>
 public void Dispose()
 {
     _communicator.Dispose();
 }