jgibeault / roottools

Automatically exported from code.google.com/p/roottools
0 stars 0 forks source link

File resource is not released #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
calling 
RootTools.isRootAvailable()
gets to 
internal.RootToolsInternalMethods.getMounts()
which has a line at #981 (in v2.6)

lnr = new LineNumberReader(new FileReader("/proc/mounts"));

that FileReader is never closed, please do so ;)

Original issue reported on code.google.com by materem...@gmail.com on 19 Jun 2013 at 10:44

GoogleCodeExporter commented 8 years ago
Fixed and checked in. Thanks for catching that. Attached the latest version, 
dev version 3.0.

Original comment by Stericso...@gmail.com on 19 Jun 2013 at 10:55

Attachments:

GoogleCodeExporter commented 8 years ago
Just an added comment.

The version attached I am still testing. I slimmed down the library quite a 
bit, removing deprecated methods and making some enhancements to the Shell.

I am still testing the library myself and so far I have had no issue, but just 
be aware that it is not exactly what I would call tried by fire yet :)

Original comment by Stericso...@gmail.com on 19 Jun 2013 at 10:59

GoogleCodeExporter commented 8 years ago
great speed!

I suggest you enable strict mode in your test application 
StrictMode.setThreadPolicy(new 
StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().penaltyDeath().build(
));
StrictMode.setVmPolicy(new 
StrictMode.VmPolicy.Builder().detectAll().penaltyLog().penaltyDeath().build());

since now it is internal.RootToolsInternalMethods.returnPath() having this 
issue. ;)
strict mode will show you all unclosed resourced, maybe android lint or 
inteelij idea (or android studio) analyze functionality can help you too. 

please post a new build when you have it, I'll try. 

btw please include only the library in the build, release version has a bin 
folder inside, attached version had 2 sdk3 jars. I guess they are not necessary.
Thank you.

Original comment by materem...@gmail.com on 19 Jun 2013 at 11:07

GoogleCodeExporter commented 8 years ago
Fixed again. Should be fine now. I Added Strict mode as you suggested and ran 
the test application.

Attached revised Jar

Original comment by Stericso...@gmail.com on 20 Jun 2013 at 2:20

Attachments:

GoogleCodeExporter commented 8 years ago
great, it works properly!

Original comment by materem...@gmail.com on 20 Jun 2013 at 8:24