예제 #1
0
        public void Dispose()
        {
            if (wasDisposed || Kernel.applicationQuitting)
            {
                return;
            }
            wasDisposed = true;

            OnDispose();

            //Tell subscribers that controller is disposing
            OnDisposing.Execute();
            OnDisposing.Dispose();
            OnDisposing = null;

            Disposables.Dispose();

            controllerEventsSubject.Dispose();
            controllerEventsSubject = null;
            viewEventsSubject.Dispose();
            viewEventsSubject = null;

            Model         = null;
            Container     = null;
            _eventService = null;
            _dManager     = null;

            ModelProperty.Dispose();
            ModelProperty = null;
        }
예제 #2
0
        public void Dispose()
        {
            if (wasDisposed || Kernel.applicationQuitting || this == null)
            {
                return;
            }
            wasDisposed = true;


            Disposables.Dispose();

            OnDispose();

            OnDisposing.Execute();
            OnDisposing.Dispose();
            OnDisposing = null;

            //If an error is thrown here, you are trying to dispose a model that was not bound. This should never happen/you should always bind your models and this comment is just here so you know whats wrong :)
            //_dManager.Remove(this);
            //If an error is thrown here, you are trying to dispose a model that was not bound. This should never happen/you should always bind your models and this comment is just here so you know whats wrong :)
            try {
                _dManager.Remove(this);
            }
            catch (Exception e) {
                if (!skipWarning)   // sry, but I have some cases(in my NPC-Nodes) where I have a Model but unbound. I shouldn't have used MVC-Model in the first place....
                {
                    UnityEngine.Debug.LogError("Tried to dispose unbound MVC-Model:" + GetType().ToString());
                    UnityEngine.Debug.LogException(e);
                }
            }
        }
예제 #3
0
 public void Dispose()
 {
     if (DisposalInterlock.Enter())
     {
         OnDisposing?.Invoke();
         DisposeManaged();
     }
 }
예제 #4
0
 protected virtual void CallDisposeMethods(bool Disposing)
 {
     if (Disposing)
     {
         OnDisposing?.Invoke();
         DisposeManaged();
     }
 }
예제 #5
0
 public void Dispose()
 {
     if (!disposed)
     {
         OnDisposing?.Invoke(this, new EventArgs());
         disposed = true;
     }
 }
예제 #6
0
 /// <summary>
 /// 释放资源
 /// </summary>
 public void Dispose()
 {
     OnDisposing?.Invoke();
     Close();
     timer?.Dispose();
     nodeWatchers?.Clear();
     are?.Dispose();
     GC.Collect();
 }
예제 #7
0
        public void Dispose()
        {
            if (Stream != null)
            {
                Stream.Close();
                Stream = null;

                OnDisposing?.Invoke();
            }
        }
예제 #8
0
        public void Dispose()
        {
            if (InnerRequest != null)
            {
                OnDisposing?.Invoke();

                InnerRequest.OnFinished -= OnHttpResponse;
                InnerRequest.Response?.Dispose();
                InnerRequest = null;
            }
        }
 /// <summary>
 ///     Releases unmanaged and - optionally - managed resources.
 /// </summary>
 public override void Dispose()
 {
     try
     {
         OnDisposing?.Invoke(this, new OnDisposingEventArgs(this));
     }
     finally
     {
         base.Dispose();
         Container.Dispose();
         if (OnDisposing != null)
         {
             OnDisposing -= OnDisposing;
         }
     }
 }
예제 #10
0
        public void Dispose()
        {
            if (wasDisposed || Kernel.applicationQuitting || this == null)
            {
                return;
            }
            wasDisposed = true;

            Disposables.Dispose();
            DisposablesProperty.Dispose();
            DisposablesProperty = null;

            OnDispose();

            OnDisposing.Execute();

            OnDisposing.Dispose();
            OnDisposing = null;

            OnAfterBind.Dispose();
            OnAfterBind = null;

            _dManager.Remove(this);
        }
예제 #11
0
 protected override void Dispose(bool disposing)
 {
     OnDisposing?.Invoke(this);
     base.Dispose(disposing);
     ServiceProvider.TryDispose();
 }
예제 #12
0
파일: Lst.cs 프로젝트: nordril/functional
 /// <summary>
 /// Disposes the list and, perhaps, compacts the underlying list.
 /// </summary>
 public void Dispose()
 {
     OnDisposing?.Invoke(startIncl, endExcl);
 }
예제 #13
0
 public override void Dispose()
 {
     OnDisposing?.Invoke();
 }