Bug 1440347 - Lock while modifying mAllocations. r=padenot

--HG--
extra : rebase_source : 2f5c6e13e8f930b82ff26190485bb8eed69592e4
extra : histedit_source : 0b3cfe11cdd16ee5bf42eec68196de9531e2c36b
This commit is contained in:
Andreas Pehrson 2018-02-23 10:20:01 +01:00
parent ded2e9e8e2
commit ce1efe51da

View File

@ -586,7 +586,12 @@ MediaEngineWebRTCMicrophoneSource::Allocate(const dom::MediaTrackConstraints &aC
if (NS_FAILED(rv)) {
return rv;
}
mAllocations.AppendElement(Allocation(handle));
{
MutexAutoLock lock(mMutex);
mAllocations.AppendElement(Allocation(handle));
}
handle.forget(aOutHandle);
return NS_OK;
}