• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is there Memory leak..?

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Folks look at this method...do u find any problem in this method as far as memory is concenr..is there any memory leak in this..?


protected static Image loadImage(Image img, String strImage) {
if(img != null) return img;
Image img2 = null;

try
{
img2 = Image.createImage(strImage);
}
catch (Exception e)
{
System.out.println ("Image loading error: "+strImage);
e.printStackTrace();

}
return img2;
}

Usage: Image mapBG = loadImage(mapBG,"/map.png");
reply
    Bookmark Topic Watch Topic
  • New Topic