Bug 330464 - multiPageEditor template leaks SWT Font
Summary: multiPageEditor template leaks SWT Font
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Curtis Windatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2010-11-17 10:40 EST by Remy Suen CLA
Modified: 2010-11-17 11:56 EST (History)
1 user (show)

See Also:


Attachments
PDE templates patch v1 (887 bytes, patch)
2010-11-17 11:44 EST, Remy Suen CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.