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.
Created attachment 8669093 [details] [diff] [review] fix widget leak in LookupRegisteredPluginWindow 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+
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox44: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.