Skip to content

Fix "A resource failed to call close." warnings.

Ryan Harg requested to merge bugfix/missing-close into develop

The leaking resource is the BufferedReader returned from FFACache.get(). This is called from several places, most often to read one or all lines of a file.

Add getLine/getLines to FFACache to return the needed line or lines, closing the BufferedReader in the FFACache module. Where the BufferedReader itself is needed (Repository.fromCache), ensure the BufferedReader is closed after use.

The offending resource was identified with:

StrictMode.setVmPolicy(StrictMode.VmPolicy.Builder(). detectLeakedClosableObjects().penaltyLog().build())

Closes #119 (closed)

Edited by Ryan Harg

Merge request reports