In *Alien*, the crew, finding themselves unable to kill the titular character, set the Nostromo to self-destruct and attempt to escape in the shuttle.

But why destroy it? It actually cost extra effort to destroy the ship. If they just left, the Alien couldn't get at them, and they wouldn't have destroyed a perfectly good ship with its extremely valuable cargo.