# HG changeset patch # User Kris Maglione # Date 1520892242 25200 # Node ID dfdfc8e56c31538f820d436a42fcfb24d583b26a # Parent 37437fd89b110367f2769d014eba1be9cfa9b353 Bug 1444680: Follow-up: Release StreamFilterParent::mChannel on main thread. r=mixedpuppy a=bustage DONTBUILD CLOSED TREE Running the StreamFilter tests as parallel xpcshell tests uncovered a race, in which we sometimes wind up releasing the last reference to an HttpChannel on a background thread, and its destructor attempts to free things which can only be freed on the main thread. diff --git a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp --- a/toolkit/components/extensions/webrequest/StreamFilterParent.cpp +++ b/toolkit/components/extensions/webrequest/StreamFilterParent.cpp @@ -111,16 +111,18 @@ StreamFilterParent::StreamFilterParent() , mSentStop(false) , mContext(nullptr) , mOffset(0) , mState(State::Uninitialized) {} StreamFilterParent::~StreamFilterParent() { + NS_ReleaseOnMainThreadSystemGroup("StreamFilterParent::mChannel", + mChannel.forget()); NS_ReleaseOnMainThreadSystemGroup("StreamFilterParent::mOrigListener", mOrigListener.forget()); NS_ReleaseOnMainThreadSystemGroup("StreamFilterParent::mContext", mContext.forget()); } bool StreamFilterParent::Create(dom::ContentParent* aContentParent, uint64_t aChannelId, const nsAString& aAddonId,