Bug 1171716 - Part 3: Use NS_ReleaseOnMainThread in WebSocketChannel dtor. r=froydnj

This commit is contained in:
Eric Rahm 2015-06-10 08:33:30 -07:00
parent 37a9c755f6
commit cf6e11c89f

View File

@ -1185,33 +1185,13 @@ WebSocketChannel::~WebSocketChannel()
while ((mCurrentOut = (OutboundMessage *) mOutgoingMessages.PopFront()))
delete mCurrentOut;
nsCOMPtr<nsIThread> mainThread;
nsIURI *forgettable;
NS_GetMainThread(getter_AddRefs(mainThread));
if (mURI) {
mURI.forget(&forgettable);
NS_ProxyRelease(mainThread, forgettable, false);
}
if (mOriginalURI) {
mOriginalURI.forget(&forgettable);
NS_ProxyRelease(mainThread, forgettable, false);
}
NS_ReleaseOnMainThread(mURI);
NS_ReleaseOnMainThread(mOriginalURI);
mListenerMT = nullptr;
if (mLoadGroup) {
nsILoadGroup *forgettableGroup;
mLoadGroup.forget(&forgettableGroup);
NS_ProxyRelease(mainThread, forgettableGroup, false);
}
if (mLoadInfo) {
nsILoadInfo *forgetableLoadInfo;
mLoadInfo.forget(&forgetableLoadInfo);
NS_ProxyRelease(mainThread, forgetableLoadInfo, false);
}
NS_ReleaseOnMainThread(mLoadGroup);
NS_ReleaseOnMainThread(mLoadInfo);
}
NS_IMETHODIMP