/* Destroy the Dhcp6 instance and recycle the resources. */
VOID Dhcp6DestroyInstance(IN OUT DHCP6_INSTANCE *Instance)
/* Destroy the Dhcp6 instance and recycle the resources. */
VOID Dhcp6DestroyInstance(IN OUT DHCP6_INSTANCE *Instance)
{
  Dhcp6CleanupRetry (Instance, DHCP6_PACKET_ALL);
  gBS->CloseEvent (Instance->Timer);
  if (Instance->Config != NULL) {
    Dhcp6CleanupConfigData (Instance->Config);
    FreePool (Instance->Config);
  }
  if (Instance->IaCb.Ia != NULL) {
    if (Instance->IaCb.Ia->ReplyPacket != NULL) {
      FreePool (Instance->IaCb.Ia->ReplyPacket);
    }
    FreePool (Instance->IaCb.Ia);
  }
  if (Instance->Unicast != NULL) {
    FreePool (Instance->Unicast);
  }
  if (Instance->AdSelect != NULL) {
    FreePool (Instance->AdSelect);
  }
  FreePool (Instance);
}