mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
dispose created fonts - they are not disposed automatically by SWT
This commit is contained in:
parent
4e6cc3202b
commit
43c9a048f0
@ -1,3 +1,6 @@
|
||||
Unreleased:
|
||||
- Cleanup some GUI resource leaks
|
||||
|
||||
Changes in 3.7.3:
|
||||
- Local IP address popup will now list IPv6 addresses and support IPv6 netmasks
|
||||
- Support for silent uninstall on Windows #263
|
||||
|
||||
@ -41,6 +41,7 @@ public class InfoDialog extends AbstractModalDialog {
|
||||
FontData sysFontData = shell.getFont().getFontData()[0];
|
||||
titleLabel.setLayoutData(formData(new FormAttachment(iconLabel), null, new FormAttachment(0), null));
|
||||
titleLabel.setFont(new Font(null, sysFontData.getName(), sysFontData.getHeight() + 3, sysFontData.getStyle() | SWT.BOLD));
|
||||
titleLabel.addDisposeListener(e -> titleLabel.getFont().dispose());
|
||||
titleLabel.setText(title2);
|
||||
|
||||
Text statsText = new Text(shell, SWT.MULTI | SWT.READ_ONLY);
|
||||
@ -62,16 +63,10 @@ public class InfoDialog extends AbstractModalDialog {
|
||||
return super.getShellStyle() | SWT.SHEET;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the message.
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message The message to set.
|
||||
*/
|
||||
public InfoDialog setMessage(String message) {
|
||||
this.message = message;
|
||||
return this;
|
||||
|
||||
@ -46,7 +46,9 @@ public class LayoutHelper {
|
||||
public static Font iconFont(Shell shell) {
|
||||
FontData fontData = shell.getFont().getFontData()[0];
|
||||
fontData.setHeight(fontData.getHeight() * 4/3);
|
||||
return new Font(shell.getDisplay(), fontData);
|
||||
Font font = new Font(shell.getDisplay(), fontData);
|
||||
shell.addDisposeListener(e -> font.dispose());
|
||||
return font;
|
||||
}
|
||||
|
||||
public static Image icon(final String baseName) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user