The code check was correct - never do such a thing (or if something like this is required by external code, then this code is probably not designed properly - there are exceptions, but for things like threads that are practically absent there , and some default patterns should always be followed).
in most cases they use such streams (from "outside") ...
using(Stream stream = new ...) { ...call your method }
(or, for example, the reader gets rid of it, but he recommended that you do something similar anyway - the equivalent uses the finally block, but it boils down to that)
... basically the calling function will never know if you deleted it inside or not until it crashes. If the โboth sidesโ agree to something similar, then this is still unacceptable, but may go unpunished.
NSGaga
source share