void CompositorChild::Destroy() { mLayerManager->Destroy(); mLayerManager = nullptr; while (size_t len = ManagedPLayerTransactionChild().Length()) { LayerTransactionChild* layers = static_cast<LayerTransactionChild*>(ManagedPLayerTransactionChild()[len - 1]); layers->Destroy(); } SendStop(); }
void RenderFrameChild::Destroy() { size_t numChildren = ManagedPLayerTransactionChild().Length(); NS_ABORT_IF_FALSE(0 == numChildren || 1 == numChildren, "render frame must only have 0 or 1 layer forwarder"); if (numChildren) { LayerTransactionChild* layers = static_cast<LayerTransactionChild*>(ManagedPLayerTransactionChild()[0]); layers->Destroy(); // |layers| was just deleted, take care } Send__delete__(this); // WARNING: |this| is dead, hands off }