Bug 1918174 - prevent proxy from being destroyed when the task is running. r=media-playback-reviewers,padenot

Differential Revision: https://phabricator.services.mozilla.com/D221901
This commit is contained in:
alwu 2024-09-12 16:08:08 +00:00
Родитель 6629a64e75
Коммит 16c3693cdb
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -372,7 +372,9 @@ bool MFMediaEngineWrapper::SetCDMProxy(CDMProxy* aProxy) {
MOZ_ASSERT(IsInited());
Unused << ManagerThread()->Dispatch(NS_NewRunnableFunction(
"MFMediaEngineWrapper::SetCDMProxy",
[engine = mEngine, proxyId] { engine->SendSetCDMProxyId(proxyId); }));
[engine = mEngine, proxy = RefPtr{aProxy}, proxyId] {
engine->SendSetCDMProxyId(proxyId);
}));
return true;
#else
return false;