Closed Bug 1163446 Opened 5 years ago Closed 5 years ago
drop reference to Font
Face once a Font Face Buffer Source is loaded
A FontFaceBufferSource encapsulates an ArrayBuffer(Source) for gfxUserFontSet. It holds a strong reference to the FontFace which initially owns the buffer. Once the gfxUserFontSet takes ownership of the buffer to parse it as a font, the FontFaceBufferSource no longer needs a reference to the FontFace. Dropping the reference to the FontFace is needed for bug 1161413, where we can no longer rely on a call to FontFaceSet::DestroyUserFontSet at pres context destruction time to drop enough references so that we don't leak. Otherwise a simple document like this will leak: <script>new FontFace("x", new ArrayBuffer(0))</script> as the gfxUserFontSet holds on to the FontFace (through the FontFaceBufferSource in its mSrcList). We could alternatively traverse/unlink the FontFace reference in FontFaceBufferSource from FontFaceSet's CC macros, but it's easier to just drop the reference here.
Attachment #8603895 - Flags: review?(jdaggett)
You need to log in before you can comment on or make changes to this bug.