Bug 1515873 - Don't create a backend as part of cleanup. r=jib

There's no guarantee a backend exists when a MediaManager does, and
crash-stats shows that shutdown can occur between posting a task and running
it, making it illegal to create a backend anew.

We're safer off avoiding creating a new backend. The cleanup step we're trying
to do is only effective if a backend already exists anyway.

Differential Revision: https://phabricator.services.mozilla.com/D15631

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2019-01-03 04:21:09 +00:00
Родитель e72c999524
Коммит 4e9e43bc92
1 изменённых файлов: 3 добавлений и 1 удалений

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

@ -3404,7 +3404,9 @@ void MediaManager::OnNavigation(uint64_t aWindowID) {
MediaManager::PostTask(
NewTaskFrom([self = RefPtr<MediaManager>(this), aWindowID]() {
self->GetBackend()->ReleaseResourcesForWindow(aWindowID);
if (self->mBackend) {
self->mBackend->ReleaseResourcesForWindow(aWindowID);
}
}));
}