• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there Memory leak..?

 
vishwas bhatt
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • 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");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic