font cache shutdown order issues

RESOLVED FIXED in mozilla1.9.1b1

Status

()

Core
Graphics
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: karlt, Assigned: karlt)

Tracking

Trunk
mozilla1.9.1b1
x86
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 1 obsolete attachment)

(Assignee)

Description

9 years ago
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.
(Assignee)

Comment 1

9 years ago
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.
(Assignee)

Comment 2

9 years ago
Created attachment 338047 [details] [diff] [review]
b) Shutdown the gfxFontCache after gPlatform

This is the simplest and looks like it should work.
(Assignee)

Comment 3

9 years ago
Created attachment 338048 [details] [diff] [review]
c) Make gfxFont more tolerant to shutdown of the gfxFontCache [backed-out]

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)
(Assignee)

Comment 4

9 years ago
Created attachment 338049 [details] [diff] [review]
fix compiler warning re initialization [pushed]

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)
Attachment #338048 - Flags: review?(roc) → review+
Comment on attachment 338048 [details] [diff] [review]
c) Make gfxFont more tolerant to shutdown of the gfxFontCache [backed-out]

I like this.
Attachment #338049 - Flags: review?(roc) → review+
(Assignee)

Comment 6

9 years ago
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]
(Assignee)

Comment 7

9 years ago
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]
(Assignee)

Updated

9 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED

Updated

9 years ago
Depends on: 455791
(Assignee)

Comment 8

9 years ago
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]
(Assignee)

Updated

9 years ago
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(Assignee)

Comment 9

9 years ago
Created attachment 339689 [details] [diff] [review]
Make gfxFont more tolerant to shutdown of the gfxFontCache v1.1 [pushed]

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
(Assignee)

Comment 10

9 years ago
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]
(Assignee)

Updated

9 years ago
Status: REOPENED → RESOLVED
Last Resolved: 9 years ago9 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.