Giter VIP home page Giter VIP logo

Comments (7)

jadar avatar jadar commented on August 11, 2024

Right, my bad. What you need to do is find where the IS is used and add a stream.close() in a finally. Then submit a PR. :)

On Aug 4, 2014, at 5:02 PM, freddag [email protected] wrote:

hi i found a resource leak on the line "is = new FileInputStream(file);" in context below i dont know enough about it but it seems that is can cause quite abit of lag over time. the finally staement at the end apears to not end normally.

public InputStream getStreamForFile(File file) {
InputStream is = null;
try {
is = new FileInputStream(file);
} catch (FileNotFoundException e) {
e.printStackTrace();
} finally {
return is;
}
}

cheers freddag


Reply to this email directly or view it on GitHub.

from developercapes.

freddag avatar freddag commented on August 11, 2024

I am unable to find where I need to put stream.close(); the statement that is using it is the one from the bug report submit above that particular method doesn't get called any where that I can find and when I do put it in the finally statement for that method I get the error "stream cant be resolved." I have no idea sorry I am new to coding and don't know a huge amount of advanced stuff yet still learning.

cheers freddag

from developercapes.

CaptainShadows avatar CaptainShadows commented on August 11, 2024

if it is not used within the API then this should be closed as there is no resource leak, the person calling the method should know that they have to close it. Although it might seem redundant to those that understand that much, we might want to specify that the caller needs to close it themselves.

from developercapes.

jadar avatar jadar commented on August 11, 2024

Yah, I just forgot to close it. We can add that to the docs.

On Aug 4, 2014, at 6:37 PM, Captain Shadows [email protected] wrote:

if it is not used within the API then this should be closed as there is no resource leak, the person calling the method should know that they have to close it. Although it might seem redundant to those that understand that much, we might want to specify that the caller needs to close it themselves.


Reply to this email directly or view it on GitHub.

from developercapes.

freddag avatar freddag commented on August 11, 2024

i guess this can be closed then. i dont see it effecting the use of the api/library

from developercapes.

jadar avatar jadar commented on August 11, 2024

It should be fixed now.

from developercapes.

freddag avatar freddag commented on August 11, 2024

cheers =)
great api you have made looking forward to using it =)

from developercapes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.