Bug 330464

Summary: multiPageEditor template leaks SWT Font
Product: [Eclipse Project] PDE Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public
Version: 3.7Keywords: contributed
Target Milestone: 3.7 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
PDE templates patch v1 none

Description Remy Suen CLA 2010-11-17 10:40:23 EST
http://dev.eclipse.org/viewcvs/index.cgi/pde/ui/org.eclipse.pde.ui.templates/templates_3.0/multiPageEditor/java/%24editorClassName%24.java?view=markup

In the generated file, the font is disposed (if non-null) and "recreated" when setFont() is called.

It should also dispose the font when the dispose() method is invoked or else the font resource will be leaked.
Comment 1 Remy Suen CLA 2010-11-17 11:44:49 EST
Created attachment 183315 [details]
PDE templates patch v1

Dispose the font in the dispose() method. Also included an inlined comment for educational purposes.
Comment 2 Curtis Windatt CLA 2010-11-17 11:56:32 EST
A comment and everything, awesome Remy.  Fixed in HEAD.