Bug 913821 - Fix the TextureHost linked list. r=sotaro

This commit is contained in:
Nicolas Silva 2013-09-10 13:41:15 +02:00
parent 5df1c0a5aa
commit 2b26f8b179

View File

@ -60,11 +60,18 @@ CompositableHost::AddTextureHost(TextureHost* aTexture)
void
CompositableHost::RemoveTextureHost(uint64_t aTextureID)
{
if (mFirstTexture && mFirstTexture->GetID() == aTextureID) {
RefPtr<TextureHost> toRemove = mFirstTexture;
mFirstTexture = mFirstTexture->GetNextSibling();
toRemove->SetNextSibling(nullptr);
}
RefPtr<TextureHost> it = mFirstTexture;
while (it) {
if (it->GetNextSibling() &&
it->GetNextSibling()->GetID() == aTextureID) {
RefPtr<TextureHost> toRemove = it->GetNextSibling();
it->SetNextSibling(it->GetNextSibling()->GetNextSibling());
toRemove->SetNextSibling(nullptr);
}
it = it->GetNextSibling();
}