diff --git a/src/servers/app/font/FontCacheEntry.cpp b/src/servers/app/font/FontCacheEntry.cpp index 39b64d295e..fd2428d891 100644 --- a/src/servers/app/font/FontCacheEntry.cpp +++ b/src/servers/app/font/FontCacheEntry.cpp @@ -304,7 +304,8 @@ FontCacheEntry::CreateGlyph(uint32 glyphCode, FontCacheEntry* fallbackEntry) // get the normal space glyph glyphIndex = engine->GlyphIndexForGlyphCode(0x20 /* space */); } else { - // render the "missing glyph box" (by simply keeping glyphIndex 0) + // The glyph was not found anywhere. + return NULL; } } diff --git a/src/servers/app/font/GlyphLayoutEngine.h b/src/servers/app/font/GlyphLayoutEngine.h index 8ed8d198a2..963c0ca6e4 100644 --- a/src/servers/app/font/GlyphLayoutEngine.h +++ b/src/servers/app/font/GlyphLayoutEngine.h @@ -309,9 +309,15 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry( // glyphs from it. We need to obtain the fallback font while we have not // locked anything, since locking the FontManager with the write-lock held // can obvisouly lead to a deadlock. + + bool writeLocked = entry->IsWriteLocked(); - cacheReference.SetTo(NULL, false); - entry->ReadUnlock(); + if (writeLocked) { + entry->WriteUnlock(); + } else { + cacheReference.SetTo(NULL, false); + entry->ReadUnlock(); + } if (gFontManager->Lock()) { // TODO: We always get the fallback glyphs from VL Gothic at the @@ -342,8 +348,10 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry( return false; } - // Update the FontCacheReference, since the locking kind changed. - cacheReference.SetTo(entry, true); + if (!writeLocked) { + // Update the FontCacheReference, since the locking kind changed. + cacheReference.SetTo(entry, true); + } return true; }