Skip to content

Commit

Permalink
Bug 1780540 - Don't forget charmap after setting in a font entry. r=j…
Browse files Browse the repository at this point in the history
…fkthame

Differential Revision: https://phabricator.services.mozilla.com/D152379
  • Loading branch information
emilio committed Jul 21, 2022
1 parent 19f3d0a commit a829fc3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gfx/thebes/gfxDWriteFontList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ nsresult gfxDWriteFontEntry::ReadCMAP(FontInfoData* aFontInfoData) {
// Temporarily retain charmap, until the shared version is
// ready for use.
if (mCharacterMap.compareExchange(nullptr, charmap.get())) {
Unused << charmap.forget();
charmap.get()->AddRef();
}
}

Expand Down
1 change: 1 addition & 0 deletions gfx/thebes/gfxFT2FontList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ nsresult FT2FontEntry::ReadCMAP(FontInfoData* aFontInfoData) {
}
if (setCharMap) {
if (mCharacterMap.compareExchange(nullptr, charmap.get())) {
// We forget rather than addref because we don't use the charmap below.
Unused << charmap.forget();
}
}
Expand Down
2 changes: 1 addition & 1 deletion gfx/thebes/gfxFcPlatformFontList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ nsresult gfxFontconfigFontEntry::ReadCMAP(FontInfoData* aFontInfoData) {
}
if (setCharMap) {
if (mCharacterMap.compareExchange(nullptr, charmap.get())) {
Unused << charmap.forget();
charmap.get()->AddRef();
}
}

Expand Down
2 changes: 1 addition & 1 deletion gfx/thebes/gfxGDIFontList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ nsresult GDIFontEntry::ReadCMAP(FontInfoData* aFontInfoData) {
charmap->mBuildOnTheFly = true;
}
if (mCharacterMap.compareExchange(nullptr, charmap.get())) {
Unused << charmap.forget();
charmap.get()->AddRef();
}

LOG_FONTLIST(("(fontlist-cmap) name: %s, size: %zd hash: %8.8x%s\n",
Expand Down
2 changes: 1 addition & 1 deletion gfx/thebes/gfxMacPlatformFontList.mm
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ static void GetStringForNSString(const NSString* aSrc, nsAString& aDest) {
// Temporarily retain charmap, until the shared version is
// ready for use.
if (mCharacterMap.compareExchange(nullptr, charmap.get())) {
Unused << charmap.forget();
charmap.get()->AddRef();
}
}

Expand Down

0 comments on commit a829fc3

Please sign in to comment.