Closed Bug 812887 Opened 8 years ago Closed 8 years ago
User Font Set/ns Font Face Loader do not check result of ns IChannel::Async Open, resulting in leaks
nsUserFontSet will set up a channel and CORS proxy, but fail to tear down the references should nsIChannel::AsyncOpen fail, thus leaking the instance itself and referenced objects like said channel. Code in question: http://mxr.mozilla.org/mozilla-central/source/layout/style/nsFontFaceLoader.cpp#383 Note how the code will call fontLoader->DropChannel should listener->Init() fail, but not when channel->AsyncOpen fails a couple of lines down the block. This blocks (mochikit-o orange due to leaks) my fix for bug 719180, which, as a side effect, will make the channel fail early on AsyncOpen in some cases where before it would only fail later via OnStopRequest. However, even without the fix from bug 719180 there are cases where AsyncOpen might fail early and hence has nsUserStyleSet leak.
This will correctly call DropChannel() not only if listener->Init() fails, but also when channel->AsyncOpen() does fail. Green try with that patch (same code, different name): https://tbpl.mozilla.org/?tree=Try&rev=aa22b56b4cfb The other changesets can be considered tests; would be leak-orange on mochikit-o without this patch.
Attachment #682893 - Flags: review?(bzbarsky)
Comment on attachment 682893 [details] [diff] [review] Fix nsUserFontSet not dropping the channel when nsIChannel::AsyncOpen fails r=me
Attachment #682893 - Flags: review?(bzbarsky) → review+
Checkin-needed. Green try: https://tbpl.mozilla.org/?tree=Try&rev=aa22b56b4cfb
Assignee: nobody → MaierMan
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Comment on attachment 682893 [details] [diff] [review] Fix nsUserFontSet not dropping the channel when nsIChannel::AsyncOpen fails See bug 719180 comment 43
You need to log in before you can comment on or make changes to this bug.