Community Forums

Home » Vuze Forums » Development » Bug Reports


Thread: azureus.ui.swt.views.list.ListView.handleResize leaking Image objects


Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 1 - Pages: 1 - Last Post: Jan 12, 2008 10:19 AM Last Post By: The 8472
yahave

Posts: 5
Registered: 12/26/07
azureus.ui.swt.views.list.ListView.handleResize leaking Image objects
Posted: Jan 7, 2008 11:48 AM
  Click to reply to this thread Reply
handleResize mixes the case of imgView == null (no previous image is known for taking previous bounds) and the case of forced resize (flag bForce is true).
As a result, there are cases in which a new Image is created without properly disposing the previous Image stored in imgView.
The offending allocation together with the required local fix code are shown below.
(alternatively, a more clean solution would need to clearly separate cases in this method)

protected void handleResize(boolean bForce) {
// ...
if (imgView == null || bForce) {
if (DEBUGPAINT) {
logPAINT("first resize (img null)");
}
// BEGIN FIX
if (imgView != null && !imgView.isDisposed()) {
imgView.dispose();
}
// END FIX
imgView = new Image(listCanvas.getDisplay(), clientArea);
lastBounds = new Rectangle(0, 0, 0, 0);
bNeedsRefresh = true;
} else {
// ...
// properly disposes of old imgView when a new one is created
}
// ...
}
The 8472

Posts: 2,147
Registered: 11/13/07
Re: azureus.ui.swt.views.list.ListView.handleResize leaking Image objects
Posted: Jan 12, 2008 10:19 AM   in response to: yahave in response to: yahave
  Click to reply to this thread Reply
fixed in next build
Legend
Master: 200 - 999 pts
Expert: 150 - 199 pts
Advanced: 100 - 149 pts
Intermediate: 50 - 99 pts
Beginner: 10 - 49 pts
Newbie: 0 - 9 pts
Vuze Staff Member
Vuze Project Developer
Vuze Community Moderator
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums