WheelMUD icon indicating copy to clipboard operation
WheelMUD copied to clipboard

Disposables are not always 'using'

Open DavidRieman opened this issue 4 years ago • 4 comments

Although some of these were fixed already, we may be missing other opportunities to release stream resource locks and such in a timely manner. We should do a pass looking for common IDisposables like StreamReaders, StreamWriters, and so on, and wrap them properly in using(...) { ... }

Perhaps assess an object inheritance tree or whatnot to find which classes we use that might be IDisposable without even realizing it.

With the latest syntactic sugar, we don't even need the { } scope for these. e.g.

using var stream = new MemoryStream();
using var compressedStream = new DeflaterOutputStream(stream);
...
return returnBytes;

DavidRieman avatar Dec 13 '20 08:12 DavidRieman

@DrunkenImpGameStudio is starting this. (I don't know why it isn't letting me assign this ticket yet.)

DavidRieman avatar Mar 05 '21 18:03 DavidRieman

I'll handle this.

ghost avatar Mar 06 '21 01:03 ghost

If this is still ongoing I will take a look.

jlechem avatar Sep 22 '24 21:09 jlechem

This looks like it has been completed.

jlechem avatar Sep 23 '24 01:09 jlechem