Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354681 - Seven SWT resources and one widget leaked in FindToolbar
Summary: Seven SWT resources and one widget leaked in FindToolbar
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.1   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Kevin Sawicki CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-12 19:44 EDT by Remy Suen CLA
Modified: 2011-08-14 19:47 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2011-08-12 19:44:18 EDT
In line 166, a menu is created on the shell of the toolbar. This menu does not get disposed when the toolbar gets disposed. This means that the menu will stick around until the shell has been closed. For the average user that only has one workbench window for their Eclipse session, this means it will leak for the lifetime of their Eclipse session.

On line 411, Widget's dispose() method is overridden. This is not how to get notifications about the widget being disposed. This causes a leak of six Image instances and one Color instance.

From the javadoc of dispose():
"NOTE: This method is not called recursively on the descendants of the receiver. This means that, widget implementers can not detect when a widget is being disposed of by re-implementing this method, but should instead listen for the Dispose event."
Comment 1 Kevin Sawicki CLA 2011-08-13 11:54:51 EDT
Thanks for reporting this, proposed fixed pushed to: http://egit.eclipse.org/r/#change,3995
Comment 2 Matthias Sohn CLA 2011-08-14 19:47:41 EDT
merged as 2188667c1e62625f1956e7a54e944135bc16ea3e