Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

org.eclipse.birt.report.designer.internal.ui.editors.script.JSEditor is leaking Fonts #734

Closed
claesrosell opened this issue Nov 21, 2021 · 1 comment · Fixed by #748
Closed

Comments

@claesrosell
Copy link
Contributor

JSEditor.setDescriptionText(String text) is creating a new Font on every call.

private void setDescriptionText(String text) {
	Font font = descriptionText.getFont();
	FontData[] fontData = font.getFontData();
	....
	descriptionText.setFont(new Font(font.getDevice(), fontData));
	descriptionText.setText(description);
}

We should probably use BIRTS FontManager or the backing JFaceResources.getFontRegistry() directly instead.

@wimjongman
Copy link
Contributor

wimjongman commented Nov 22, 2021

Yes. good catch. In this case, something like this can also work.

  Font font = new Font(font.getDevice(), fontData);
  descriptionText.setFont(font);
  descriptionText.addListener(SWT.Dispose, e-> font.dispose());

claesrosell added a commit to claesrosell/birt that referenced this issue Nov 25, 2021
No longer generating fonts for this label, but using the FontRegistry to
access JFace default fonts.
@wimjongman wimjongman linked a pull request Nov 25, 2021 that will close this issue
ruspl-afed added a commit that referenced this issue Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants