Bug 1332845 - Remove listeners before other cleanup in MediaRecorder. r=jesup

There was an indirect race from destroying this MediaInputPort before removing
the direct listener.

MozReview-Commit-ID: 7rPzsLL4EvG

--HG--
extra : rebase_source : 6271778593079609119153ce8b81587a9188d8ba
This commit is contained in:
Andreas Pehrson 2017-04-07 16:50:55 +02:00
Родитель b38be6eedc
Коммит 5835686871
1 изменённых файлов: 6 добавлений и 5 удалений

Просмотреть файл

@ -825,11 +825,6 @@ private:
}
mInputStream = nullptr;
}
for (RefPtr<MediaInputPort>& inputPort : mInputPorts) {
MOZ_ASSERT(inputPort);
inputPort->Destroy();
}
mInputPorts.Clear();
if (mTrackUnionStream) {
if (mEncoder) {
@ -855,6 +850,12 @@ private:
mTrackUnionStream = nullptr;
}
for (RefPtr<MediaInputPort>& inputPort : mInputPorts) {
MOZ_ASSERT(inputPort);
inputPort->Destroy();
}
mInputPorts.Clear();
if (mMediaStream) {
mMediaStream->UnregisterTrackListener(this);
mMediaStream = nullptr;