Why call Dispose()? Memory leak won't occur?

前端 未结 7 739
无人及你
无人及你 2020-12-29 10:01

Edit: My question isn\'t getting the main answer that I was looking for. I wasn\'t clear. I would really like to know two things:

  1. Can NOT call
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 10:31

    Dispose() is intended to free resources that the garbage collector won't free, such as database connections. These resources should also be freed in the finalizer, however the finalizer is much slower than the Dispose() method.

提交回复
热议问题