Last Comment Bug 717498 - nsThread::mEventObservers doesn't get cleared at thread shutdown
: nsThread::mEventObservers doesn't get cleared at thread shutdown
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla12
Assigned To: Bobby Holley (:bholley) (busy with Stylo)
:
: Nathan Froyd [:froydnj]
Mentors:
Depends on:
Blocks: 716167
  Show dependency treegraph
 
Reported: 2012-01-11 19:12 PST by Bobby Holley (:bholley) (busy with Stylo)
Modified: 2012-01-16 04:54 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Bug 717498 - Clear nsThread::mEventObservers at thread shutdown. v1 (2.31 KB, patch)
2012-01-11 19:15 PST, Bobby Holley (:bholley) (busy with Stylo)
no flags Details | Diff | Splinter Review
Bug 717498 - Clear nsThread::mEventObservers at thread shutdown. v1 (2.29 KB, patch)
2012-01-11 19:20 PST, Bobby Holley (:bholley) (busy with Stylo)
benjamin: review+
Details | Diff | Splinter Review

Description Bobby Holley (:bholley) (busy with Stylo) 2012-01-11 19:12:38 PST
Once the thread manager shuts down, calls to NS_GetCurrentThread return null. So any consumers with registered observers (such as nsXPConnect) have no way to unregister themselves if their shutdown happens after ThreadManager shutdown. This can lead to cycles.

Ideally we'd unify the whole SetObserver vs AddObserver setup, but that's a task for another day.
Comment 1 Bobby Holley (:bholley) (busy with Stylo) 2012-01-11 19:15:24 PST
Created attachment 587920 [details] [diff] [review]
Bug 717498 - Clear nsThread::mEventObservers at thread shutdown. v1

Attaching a patch. Flagging bsmedberg for review.
Comment 2 Bobby Holley (:bholley) (busy with Stylo) 2012-01-11 19:20:28 PST
Created attachment 587921 [details] [diff] [review]
Bug 717498 - Clear nsThread::mEventObservers at thread shutdown. v1

Err, that patch had slightly erroneous context due to its location in my patch stack. Here's a version rebased to mozilla-central.
Comment 3 Bobby Holley (:bholley) (busy with Stylo) 2012-01-14 10:59:04 PST
Pushed to m-i: http://hg.mozilla.org/integration/mozilla-inbound/rev/3f65bc07bd89
Comment 4 Jonathan Kew (:jfkthame) 2012-01-16 04:54:07 PST
https://hg.mozilla.org/mozilla-central/rev/3f65bc07bd89

Note You need to log in before you can comment on or make changes to this bug.