Closed
Bug 1070340
Opened 10 years ago
Closed 10 years ago
Avoid interacting with the observer service from imgFrame during XPCOM shutdown
Categories
(Core :: Graphics: ImageLib, defect)
Core
Graphics: ImageLib
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: seth, Assigned: seth)
References
Details
Attachments
(2 files, 1 obsolete file)
5.63 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
1.52 KB,
patch
|
tnikkel
:
review+
|
Details | Diff | Splinter Review |
So bug 1069652 makes us call imgFrame::Optimize() during imgFrame::UnlockImageData(), which is almost always what we want, except for in one scenario: during XPCOM shutdown. In this situation, we can't let Optimize() run, because it calls getPlatform::GetPlatform(), which needs the observer service to be available. During shutdown, it's not, and we get this kind of failure: https://tbpl.mozilla.org/php/getParsedLog.php?id=48431848&tree=Try#error1 This bug will add an imagelib-global service called ShutdownTracker which lets us know whether the 'xpcom-shutdown' notification has been delivered. It's preferable to do this in a single place because shutdown observers aren't free, and we don't want to add the additional logic everywhere we need it. (And I suspect we'll need it in more places.) This bug also adds a call to ShutdownTracker::ShutdownHasStarted() in imgFrame::Optimize(), so we don't try to optimize during shutdown.
Assignee | ||
Comment 1•10 years ago
|
||
This patch adds ShutdownTracker.
Attachment #8492485 -
Flags: review?(tnikkel)
Assignee | ||
Comment 2•10 years ago
|
||
We put ShutdownTracker to work immediately by avoiding imgFrame optimization during shutdown.
Attachment #8492486 -
Flags: review?(tnikkel)
Assignee | ||
Updated•10 years ago
|
Summary: Avoid interacting with the observer service during XPCOM shutdown → Avoid interacting with the observer service from imgFrame during XPCOM shutdown
Assignee | ||
Updated•10 years ago
|
Attachment #8492486 -
Attachment is obsolete: true
Attachment #8492486 -
Flags: review?(tnikkel)
Comment 4•10 years ago
|
||
Comment on attachment 8492485 [details] [diff] [review] (Part 1) - Add ShutdownTracker to imagelib >+ /** >+ * Check whether shutdown has started. Callers can use this to check whether >+ * it's safe to access XPCOM services; if shutdown has started, such calls >+ * must be avoided. >+ * >+ * @return true if shutdown has already started. >+ */ >+ static bool ShutdownHasStarted(); This might be clearer if it was called GetHasShutdownStarted.
Attachment #8492485 -
Flags: review?(tnikkel) → review+
Updated•10 years ago
|
Attachment #8492493 -
Flags: review?(tnikkel) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Thanks for the review, Timothy! Pushed: https://hg.mozilla.org/integration/mozilla-inbound/rev/f7e8bda1300c https://hg.mozilla.org/integration/mozilla-inbound/rev/ac1a42852e62
Comment 6•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f7e8bda1300c https://hg.mozilla.org/mozilla-central/rev/ac1a42852e62
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
You need to log in
before you can comment on or make changes to this bug.
Description
•