Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public static long getFontHandle(Font font, int zoom) {
if (font == null) {
SWT.error(SWT.ERROR_NULL_ARGUMENT);
}
if (font.isDisposed()) {
return 0;
}
return Font.win32_getHandle(getFont(font.getDevice(), font.getFontData()[0], zoom));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ public void test_setFontLorg_eclipse_swt_graphics_Font() {
font.dispose();
}

@Test
public void test_CaretWithDisposedFontDoesNotThrowException_issue2323() {
Caret caret = new Caret(canvas, SWT.NONE);
Font font = new Font(canvas.getDisplay(), "Default", 10, SWT.BOLD);
shell.open();
caret.setFont(font);
font.dispose();
canvas.setFocus();
canvas.setCaret(caret);
}

/* custom*/
@Test
public void test_consistency_MenuDetect() {
Expand Down
Loading