Closed Bug 1036662 Opened 10 years ago Closed 10 years ago

Callers of NS_DispatchToMainThread should obey XPCOM conventions

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1036629

People

(Reporter: mccr8, Unassigned)

Details

(Keywords: memory-leak, Whiteboard: [MemShrink])

136 places do something like:
   NS_DispatchToMainThread(new Foo());
We're passing in the new runnable Foo() with a refcount of 0, which is not great. If the dispatch fails, we end up leaking the runnable.  This is probably not common, and likely will only affect us when we're shutting down anyways.

Because there are so many of these places and it is a very mechanical transformation, I advise writing a script.  See bug 1036629 for the pattern that should be used instead.

search query: http://mxr.mozilla.org/mozilla-central/search?string=NS_DispatchToMainThread%28new&find=&findi=&filter=&hitlimit=&tree=mozilla-central
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.