void
LayerTransactionParent::Destroy()
{
  mDestroyed = true;
  for (size_t i = 0; i < ManagedPLayerParent().Length(); ++i) {
    ShadowLayerParent* slp =
      static_cast<ShadowLayerParent*>(ManagedPLayerParent()[i]);
    slp->Destroy();
  }
}
void
LayerTransactionParent::Destroy()
{
  const ManagedContainer<PLayerParent>& layers = ManagedPLayerParent();
  for (auto iter = layers.ConstIter(); !iter.Done(); iter.Next()) {
    ShadowLayerParent* slp =
      static_cast<ShadowLayerParent*>(iter.Get()->GetKey());
    slp->Destroy();
  }
  mDestroyed = true;
}
void
LayerTransactionParent::Destroy()
{
  const ManagedContainer<PLayerParent>& layers = ManagedPLayerParent();
  for (auto iter = layers.ConstIter(); !iter.Done(); iter.Next()) {
    ShadowLayerParent* slp =
      static_cast<ShadowLayerParent*>(iter.Get()->GetKey());
    slp->Destroy();
  }
  InfallibleTArray<PTextureParent*> textures;
  ManagedPTextureParent(textures);
  for (unsigned int i = 0; i < textures.Length(); ++i) {
    RefPtr<TextureHost> tex = TextureHost::AsTextureHost(textures[i]);
    tex->DeallocateDeviceData();
  }
  mDestroyed = true;
}