Do I need to call Dispose() on managed objects?

后端 未结 11 1852
忘了有多久
忘了有多久 2020-12-08 14:51

I can\'t believe I\'m still confused about this but, any way, lets finally nail it:

I have a class that overrides OnPaint to do some drawing. To speed things up, I c

11条回答
  •  一向
    一向 (楼主)
    2020-12-08 15:10

    You need to dispose them.

    Managed object manage their memory by themselves. But memory isn't the only resource that an object uses. Dispose() is intended to release the other resources.

提交回复
热议问题