Bug 1765162 - Fix leak in GlyphCacheEntry. r=aosmond

GlyphBuffer was getting allocated but never destroyed.
This adds a destructor that fixes that.

Differential Revision: https://phabricator.services.mozilla.com/D143917
This commit is contained in:
Lee Salzman 2022-04-21 17:59:45 +00:00
parent b163e7d7a5
commit cc5a1729f6
2 changed files with 3 additions and 0 deletions

View File

@ -2266,6 +2266,8 @@ GlyphCacheEntry::GlyphCacheEntry(const GlyphBuffer& aBuffer,
mBuffer.mNumGlyphs = aBuffer.mNumGlyphs;
}
GlyphCacheEntry::~GlyphCacheEntry() { delete[] mBuffer.mGlyphs; }
// Attempt to find a matching entry in the glyph cache. If one isn't found,
// a new entry will be created. The caller should check whether the contained
// texture handle is valid to determine if it will need to render the text run

View File

@ -302,6 +302,7 @@ class GlyphCacheEntry : public CacheEntryImpl<GlyphCacheEntry> {
GlyphCacheEntry(const GlyphBuffer& aBuffer, const DeviceColor& aColor,
const Matrix& aTransform, const IntRect& aBounds,
HashNumber aHash);
~GlyphCacheEntry();
bool MatchesGlyphs(const GlyphBuffer& aBuffer, const DeviceColor& aColor,
const Matrix& aTransform, const IntRect& aBounds,