Watchmen: Basically, Veidt fakes an alien invasion in New York that, while killing half the population, unites the US and USSR against a percieved common enemy and thus prevents a nuclear way. Rorschach, refusing to compromise, leaves with the intention of revealing the truth, but allows Dr. Manhattan to kill him before he can do so. Afterwards, Veidt asks Manhattan if he did the right thing in the end, to which Manhattan replies, "Nothing ever ends", before leaving the Earth for another galaxy
I am Legend: Neville completes the antidote, but when him, Anna and Ethan get chased down by the zombies, Neville uses a hand grade to destroy the attackers at the cost of his life, while Anna and Ethan escape with the antidote, saving the rest of humanity.