Avoid loading multiple copies of a lazy glyph provider

This commit is contained in:
embeddedt 2026-03-13 19:36:15 -04:00
parent 9edce9ad91
commit 02f486ebf4
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -37,7 +37,7 @@ public class LazyGlyphProvider implements GlyphProvider {
}
}
private @Nullable GlyphProvider getGlyphProvider() {
private synchronized @Nullable GlyphProvider getGlyphProvider() {
GlyphProvider prov = innerProvider.get();
if (prov == null) {
try {
@ -61,7 +61,7 @@ public class LazyGlyphProvider implements GlyphProvider {
}
@Override
public IntSet getSupportedGlyphs() {
public synchronized IntSet getSupportedGlyphs() {
if (supportedGlyphs == null) {
var prov = getGlyphProvider();
if (prov != null) {