Closed Bug 1210912 Opened 4 years ago Closed 4 years ago
fix widget leak in Lookup
Registered Plugin Window
nsRefPtrHashtable::Get follows XPCOM outparam rules, so it addrefs its argument prior to returning it. LookupRegisteredPluginWindow, however, doesn't know anything about the additional reference, and neither does anything else that calls it (which is, fortunately, not that much code). So every widget returned by this function will leak. To fix this, we use nsRefPtrHashtable::GetWeak, which doesn't addref its argument, but merely returns the raw pointer, leaving the hashtable responsible for the owning reference.
I *think* this is a real leak, though I find it a little difficult to imagine that our tests haven't caught this...
Attachment #8669093 - Flags: review?(roc)
Attachment #8669093 - Flags: review?(roc) → review+
You need to log in before you can comment on or make changes to this bug.