Disposer.cs 366 B

1234567891011121314151617181920212223242526
  1. using Model;
  2. namespace Hotfix
  3. {
  4. public abstract class Disposer : Object, IDisposable2
  5. {
  6. public bool IsFromPool { get; set; }
  7. public bool IsDisposed { get; set; }
  8. public virtual void Dispose()
  9. {
  10. if (this.IsDisposed)
  11. {
  12. return;
  13. }
  14. this.IsDisposed = true;
  15. if (this.IsFromPool)
  16. {
  17. Hotfix.ObjectPool.Recycle(this);
  18. }
  19. }
  20. }
  21. }