Closed Bug 454735 Opened 13 years ago Closed 13 years ago

font cache shutdown order issues

Categories

(Core :: Graphics, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.1b1

People

(Reporter: karlt, Assigned: karlt)

References

Details

Attachments

(3 files, 1 obsolete file)

gfxFontCache currently requires all gfxFonts to be released before the
gGlobalCache is destroyed.

In bug 385263, other font caches (PangoFontMap and gfxPangoFontCache) will hold
references to gfxFonts, but these caches are currently shutdown during
destruction of gPlatform, which happens after shutdown of the gfxFontCache.
There are a few options here:

a) Add platform specific shutdown code to gfxPlatform.

b) Shutdown the gfxFontCache after gPlatform.

c) Make the gfxFonts more tolerant to shutdown of the gfxFontCache.
This is the simplest and looks like it should work.
I wonder whether we should do this for safety whatever.

This also makes gfxFont and gfxFontGroup constructors protected as these are
both abstract base classes.
Attachment #338048 - Flags: review?(roc)
Let's fix this compiler warning while here:

../../../dist/include/thebes/gfxFont.h: In constructor 'gfxFont::gfxFont(gfxFontEntry*, const gfxFontStyle*)':
../../../dist/include/thebes/gfxFont.h:652: warning: 'gfxFont::mStyle' will be initialized after
../../../dist/include/thebes/gfxFont.h:648: warning:   'nsRefPtr<gfxFontEntry> gfxFont::mFontEntry'
/home/karl/moz/dev/gfx/thebes/src/gfxFont.cpp:264: warning:   when initialized here
Attachment #338049 - Flags: review?(roc)
Comment on attachment 338048 [details] [diff] [review]
c) Make gfxFont more tolerant to shutdown of the gfxFontCache [backed-out]

I like this.
Comment on attachment 338049 [details] [diff] [review]
fix compiler warning re initialization [pushed]

http://hg.mozilla.org/mozilla-central/rev/b3ac8c986c84
Attachment #338049 - Attachment description: fix compiler warning re initialization → fix compiler warning re initialization [pushed]
Comment on attachment 338048 [details] [diff] [review]
c) Make gfxFont more tolerant to shutdown of the gfxFontCache [backed-out]

http://hg.mozilla.org/mozilla-central/rev/f51aad9e6a88
Attachment #338048 - Attachment description: c) Make gfxFont more tolerant to shutdown of the gfxFontCache → c) Make gfxFont more tolerant to shutdown of the gfxFontCache [pushed]
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Depends on: 455791
Comment on attachment 338048 [details] [diff] [review]
c) Make gfxFont more tolerant to shutdown of the gfxFontCache [backed-out]

Backed out for bug 455791
Attachment #338048 - Attachment description: c) Make gfxFont more tolerant to shutdown of the gfxFontCache [pushed] → c) Make gfxFont more tolerant to shutdown of the gfxFontCache [backed-out]
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
same as attachment 338048 [details] [diff] [review], but keep the |return 0| from the old code, rather than returning this->mRefCnt as |this| is sometimes already deleted.
Attachment #338048 - Attachment is obsolete: true
Comment on attachment 339689 [details] [diff] [review]
Make gfxFont more tolerant to shutdown of the gfxFontCache v1.1 [pushed]

http://hg.mozilla.org/mozilla-central/rev/33c4f7ef2174
Attachment #339689 - Attachment description: Make gfxFont more tolerant to shutdown of the gfxFontCache v1.1 → Make gfxFont more tolerant to shutdown of the gfxFontCache v1.1 [pushed]
Status: REOPENED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b1
You need to log in before you can comment on or make changes to this bug.