Updater.Dispose.cs 970 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. namespace Update.Core
  2. {
  3. partial class Updater
  4. {
  5. /// <summary>
  6. /// 释放更新包枚举器
  7. /// </summary>
  8. protected virtual void DisposeAvaliables()
  9. {
  10. if (this.m_Avaliables != null)
  11. {
  12. this.m_Avaliables.Dispose();
  13. this.m_Avaliables = null;
  14. }
  15. }
  16. /// <summary>
  17. /// 释放 WebClient
  18. /// </summary>
  19. protected virtual void DisposeClient()
  20. {
  21. if (this.m_Client != null)
  22. {
  23. this.m_Client.Dispose();
  24. this.m_Client = null;
  25. }
  26. }
  27. /// <summary>
  28. /// 释放资源
  29. /// </summary>
  30. /// <param name="disposing">释放托管资源为true,否则为false</param>
  31. protected override void Dispose(bool disposing)
  32. {
  33. this.DisposeAvaliables();
  34. this.DisposeClient();
  35. }
  36. }
  37. }