Should IDisposable.Dispose() implementations be idempotent?

前端 未结 4 1253
旧时难觅i
旧时难觅i 2020-12-18 18:28

The Microsoft.NET framework provides the IDisposable interface which requires an implementation of void Dispose() method. Its purpose is to enable

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 18:54

    From MSDN:

    Allow a Dispose method to be called more than once without throwing an exception. The method should do nothing after the first call.

提交回复
热议问题