(15)Reduce memory leaks dramatically with the “using” statement

招数15:

显式的使用using语句减少内存泄露

If a type implements IDisposable, wrap the use of it in a “using” statement, so that it automatically disposes of objects properly when the block exits.
如果一个类实现了IDisposable接口,使用using语句包裹这个类型,以便离开语句块就能自动的释放恰当的对象。

相关文章:

  • 2021-06-06
  • 2022-01-08
  • 2021-06-28
  • 2021-11-18
  • 2022-01-27
  • 2022-02-16
  • 2021-06-11
  • 2021-12-04
猜你喜欢
  • 2021-07-22
  • 2021-11-07
  • 2021-12-05
  • 2021-11-04
  • 2021-05-27
  • 2021-07-02
  • 2022-01-10
相关资源
相似解决方案