IDisposable, does it really matter

后端 未结 9 3011
予麋鹿
予麋鹿 2021-02-20 09:19

Coming from C/C++ a long time ago I still have a habit of ensuring that all resources are cleaned up correctly. I always ensure Dispose is called on IDisposable classes and impl

9条回答
  •  遥遥无期
    2021-02-20 09:49

    I had a case which I unfortunately cannot remember the details of, but it was some kind of layered streams. The lowerlevel file stream was sometimes closed before the upperlevel text formatter was flushed, which caused the last output written to the text formatter to be lost.

提交回复
热议问题