Skip to content

Commit db9f69f

Browse files
committed
Ensure font is fetched from registry even when zoom levels match
The font returned by Font.win32_new is stored in the setFont() method of widgets. Previously, if targetZoom == font.zoom, the passed font was returned directly. However, the passed font could have been disposed by user code. This change ensures that the font is always fetched from the font registry, even when the zoom levels match, avoiding potential use of disposed fonts.
1 parent 34a4d76 commit db9f69f

File tree

1 file changed

+0
-3
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+0
-3
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Font.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,6 @@ public static Font win32_new(Device device, FontData fontData, int zoom) {
402402
* @since 3.126
403403
*/
404404
public static Font win32_new(Font font, int targetZoom) {
405-
if (targetZoom == font.zoom) {
406-
return font;
407-
}
408405
return SWTFontProvider.getFont(font.getDevice(), font.getFontData()[0], targetZoom);
409406
}
410407
}

0 commit comments

Comments
 (0)