Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Should I dispose image object while no longer required?
Should I dispose image object while no longer required? [message #467809] Tue, 07 February 2006 08:39
Brandon is currently offline BrandonFriend
Messages: 1
Registered: July 2009
Junior Member
HI,

In the tutorial, it says that we should explicitly dispose the Image object.
Here comes the question:
The memory used in my program keep growing up. It's apparent that I don't
dispose some objects that required dispose manually.
In the case below, would the garbage collector cleans the image object after
MyClass object is no longer needed?
If not, how can I dispose the image object? If in C++, I can put codes in
the destructor(). How about in SWT?
Thanks!!



public class MyClass {
Image image = new Image(null, "c://a.bmp"); //?? how to clean the
memory for image object

public Image getImage(){
return this.image;
}

}
Previous Topic:Linux java.library.path file
Next Topic:swt Table data not displayed properly
Goto Forum:
  


Current Time: Fri Apr 26 14:03:49 GMT 2024

Powered by FUDForum. Page generated in 0.03139 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top