Callers of NS_DispatchToMainThread should obey XPCOM conventions

RESOLVED DUPLICATE of bug 1036629

Status

()

RESOLVED DUPLICATE of bug 1036629
4 years ago
4 years ago

People

(Reporter: mccr8, Unassigned)

Tracking

({memory-leak})

Trunk
memory-leak
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [MemShrink])

(Reporter)

Description

4 years ago
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
(Reporter)

Updated

4 years ago
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1036629
You need to log in before you can comment on or make changes to this bug.