Bug 1325158: Part 3 - Don't create a reference cycle via HTTP channel property bag. r=mixedpuppy

MozReview-Commit-ID: 40Ox7BDlgwy

--HG--
extra : rebase_source : 1ad1f43b7da1bb0be3b04814347396fc29fbb4f6
This commit is contained in:
Kris Maglione 2016-12-24 18:26:03 -08:00
parent d823573e34
commit 9822075cb5

View File

@ -813,14 +813,14 @@ HttpObserverManager = {
// Check whether we've already added a listener to this channel,
// so we don't wind up chaining multiple listeners.
let channelData = getData(channel);
if (!channelData.listener && channel instanceof Ci.nsITraceableChannel) {
if (!channelData.hasListener && channel instanceof Ci.nsITraceableChannel) {
let responseStatus = channel.responseStatus;
// skip redirections, https://bugzilla.mozilla.org/show_bug.cgi?id=728901#c8
if (responseStatus < 300 || responseStatus >= 400) {
let listener = new StartStopListener(this, loadContext);
let orig = channel.setNewListener(listener);
listener.orig = orig;
channelData.listener = listener;
channelData.hasListener = true;
}
}
}