mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
Bug 1401459 - always run HttpChannelChild::Release on main thread. r=mayhemer
--HG-- extra : rebase_source : 21705641833e1ad0cb0a3b45f8f0006d29246160
This commit is contained in:
parent
f252fd08ea
commit
b8abf494f9
@ -245,6 +245,19 @@ NS_IMPL_ADDREF(HttpChannelChild)
|
||||
|
||||
NS_IMETHODIMP_(MozExternalRefCountType) HttpChannelChild::Release()
|
||||
{
|
||||
if (!NS_IsMainThread()) {
|
||||
nsrefcnt count = mRefCnt;
|
||||
nsresult rv = NS_DispatchToMainThread(
|
||||
NewNonOwningRunnableMethod("HttpChannelChild::Release",
|
||||
this,
|
||||
&HttpChannelChild::Release));
|
||||
|
||||
// Continue Release procedure if failed to dispatch to main thread.
|
||||
if (!NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
nsrefcnt count = --mRefCnt;
|
||||
MOZ_ASSERT(int32_t(count) >= 0, "dup release");
|
||||
NS_LOG_RELEASE(this, count, "HttpChannelChild");
|
||||
|
Loading…
Reference in New Issue
Block a user