Bug 988713 - Fix the race condition between TextureClient::Finalize() and TextureChild::ActorDestroy(), r=nical

This commit is contained in:
Peter Chang 2014-04-07 10:02:31 +08:00
Родитель 5984c6c07c
Коммит 6bba9e227e
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -511,12 +511,14 @@ TextureClient::Finalize()
RefPtr<TextureChild> actor = mActor;
if (actor) {
// The actor has a raw pointer to us, actor->mTextureClient.
// Null it before RemoveTexture calls to avoid invalid actor->mTextureClient
// when calling TextureChild::ActorDestroy()
actor->mTextureClient = nullptr;
// this will call ForceRemove in the right thread, using a sync proxy if needed
if (actor->GetForwarder()) {
actor->GetForwarder()->RemoveTexture(this);
}
// The actor has a raw pointer to us, actor->mTextureClient. Null it before we die.
actor->mTextureClient = nullptr;
}
}