Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354681

Summary: Seven SWT resources and one widget leaked in FindToolbar
Product: [Technology] EGit Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Kevin Sawicki <kevin>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: matthias.sohn, pwebster
Version: 1.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

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