|
Following some image leaks, I got down to the class ImageRepository.
It seems that it has a method unLoadImages as follows:
public static void unLoadImages() {
Iterator iter;
iter = images.values().iterator();
while (iter.hasNext()) {
Image im = (Image) iter.next();
im.dispose();
}
iter = registry.values().iterator();
while (iter.hasNext()) {
Image im = (Image) iter.next();
if(im != null)
im.dispose();
}
}
Unfortunately, this method is never called in Azureus, or at least I could not find a static call (maybe called via some tortured reflection, but not likely). This particular kind of leaks may be minor, as images in the repository are long-lived and cleanup can be only called once the application is shutting down. However, on an application restart (which is probably not used very frequently) this may be of some value.
Nevertheless, it's probably good practice to dispose of these images properly.
FIX: add a call to this cleanup method in MainWindow._dispose which is a cleanup method called when the main window is closed (possibly to be restarted!).
|