Closed
Description
class A {
IOSink _sink;
void init(filename) {
_sink = new File(filename).openWrite();
}
}
Here's another linter hint that's standard-lib-specific (something like C linter hints complaining about unsafe use of memcpy
, malloc
, etc.). Whenever there is a Sink object that is opened in scope but never called close()
upon in that same scope, that's a pretty strong indication the developer forgot.
We could easily identify other similar classes that have to be closed (or unsubscribed from) when no longer in use.