зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1626278: Move sigslot stuff to STS, and ensure we disconnect before releasing our ref to the MediaTransportHandler. r=mjf
This patch fixes an intermittent crash in pre-existing mochitests/wpt. Differential Revision: https://phabricator.services.mozilla.com/D90626
This commit is contained in:
Родитель
4e17277690
Коммит
414ee0525d
|
@ -89,10 +89,16 @@ TransceiverImpl::TransceiverImpl(
|
|||
|
||||
mTransmitPipeline->SetTrack(mSendTrack);
|
||||
|
||||
mTransportHandler->SignalStateChange.connect(
|
||||
this, &TransceiverImpl::UpdateDtlsTransportState);
|
||||
mTransportHandler->SignalRtcpStateChange.connect(
|
||||
this, &TransceiverImpl::UpdateDtlsTransportState);
|
||||
auto self = nsMainThreadPtrHandle<TransceiverImpl>(
|
||||
new nsMainThreadPtrHolder<TransceiverImpl>(
|
||||
"TransceiverImpl::TransceiverImpl::self", this, false));
|
||||
mStsThread->Dispatch(
|
||||
NS_NewRunnableFunction("TransceiverImpl::TransceiverImpl", [self] {
|
||||
self->mTransportHandler->SignalStateChange.connect(
|
||||
self.get(), &TransceiverImpl::UpdateDtlsTransportState);
|
||||
self->mTransportHandler->SignalRtcpStateChange.connect(
|
||||
self.get(), &TransceiverImpl::UpdateDtlsTransportState);
|
||||
}));
|
||||
}
|
||||
|
||||
TransceiverImpl::~TransceiverImpl() = default;
|
||||
|
@ -168,7 +174,13 @@ void TransceiverImpl::Shutdown_m() {
|
|||
}
|
||||
Stop();
|
||||
mTransmitPipeline = nullptr;
|
||||
mTransportHandler = nullptr;
|
||||
auto self = nsMainThreadPtrHandle<TransceiverImpl>(
|
||||
new nsMainThreadPtrHolder<TransceiverImpl>(
|
||||
"TransceiverImpl::Shutdown_m::self", this, false));
|
||||
mStsThread->Dispatch(NS_NewRunnableFunction(__func__, [self] {
|
||||
self->disconnect_all();
|
||||
self->mTransportHandler = nullptr;
|
||||
}));
|
||||
}
|
||||
|
||||
nsresult TransceiverImpl::UpdateSendTrack(dom::MediaStreamTrack* aSendTrack) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче