mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for a very obscure race-condition involving font string initialisation.
This commit is contained in:
parent
897c3c8044
commit
f4c83a9411
2 changed files with 34 additions and 23 deletions
|
|
@ -225,10 +225,13 @@ private:
|
|||
|
||||
hits.set (0);
|
||||
misses.set (0);
|
||||
return glyphs.getLast();
|
||||
}
|
||||
|
||||
return findLeastRecentlyUsedGlyph();
|
||||
if (CachedGlyphType* g = findLeastRecentlyUsedGlyph())
|
||||
return g;
|
||||
|
||||
addNewGlyphSlots (32);
|
||||
return glyphs.getLast();
|
||||
}
|
||||
|
||||
void addNewGlyphSlots (int num)
|
||||
|
|
@ -241,8 +244,8 @@ private:
|
|||
|
||||
CachedGlyphType* findLeastRecentlyUsedGlyph() const noexcept
|
||||
{
|
||||
CachedGlyphType* oldest = glyphs.getLast();
|
||||
int oldestCounter = oldest->lastAccessCount;
|
||||
CachedGlyphType* oldest = nullptr;
|
||||
int oldestCounter = std::numeric_limits<int>::max();
|
||||
|
||||
for (int i = glyphs.size() - 1; --i >= 0;)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue