зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1790188 - Fix releasing CompositableRef of mLatestTextureHost r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D157067
This commit is contained in:
Родитель
708604622a
Коммит
87a37cfd91
|
@ -209,6 +209,7 @@ void RemoteTextureMap::KeepTextureDataAliveForTextureHostIfNecessary(
|
|||
void RemoteTextureMap::UnregisterTextureOwner(
|
||||
const RemoteTextureOwnerId aOwnerId, const base::ProcessId aForPid) {
|
||||
UniquePtr<TextureOwner> releasingOwner; // Release outside the mutex
|
||||
RefPtr<TextureHost> releasingTexture; // Release outside the mutex
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
||||
|
@ -219,6 +220,12 @@ void RemoteTextureMap::UnregisterTextureOwner(
|
|||
return;
|
||||
}
|
||||
|
||||
if (it->second->mLatestTextureHost) {
|
||||
// Release CompositableRef in mMutex
|
||||
releasingTexture = it->second->mLatestTextureHost;
|
||||
it->second->mLatestTextureHost = nullptr;
|
||||
}
|
||||
|
||||
KeepTextureDataAliveForTextureHostIfNecessary(
|
||||
lock, it->second->mUsingTextureDataHolders);
|
||||
|
||||
|
@ -233,6 +240,8 @@ void RemoteTextureMap::UnregisterTextureOwners(
|
|||
const base::ProcessId aForPid) {
|
||||
std::vector<UniquePtr<TextureOwner>>
|
||||
releasingOwners; // Release outside the mutex
|
||||
std::vector<RefPtr<TextureHost>>
|
||||
releasingTextures; // Release outside the mutex
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
||||
|
@ -244,6 +253,12 @@ void RemoteTextureMap::UnregisterTextureOwners(
|
|||
continue;
|
||||
}
|
||||
|
||||
if (it->second->mLatestTextureHost) {
|
||||
// Release CompositableRef in mMutex
|
||||
releasingTextures.emplace_back(it->second->mLatestTextureHost);
|
||||
it->second->mLatestTextureHost = nullptr;
|
||||
}
|
||||
|
||||
KeepTextureDataAliveForTextureHostIfNecessary(
|
||||
lock, it->second->mUsingTextureDataHolders);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче