Barry Allen was not having a great time of it. The second Flash finally married his girlfriend, Iris West, only for her to be killed by his arch enemy Professor Zoom. After the long and arduous process of getting over the loss of Iris and courting another woman, Zoom tries to pull the same trick again - only for Barry to catch him before he can do the deed, snapping the villain's neck in the process. Because he's dealing with this situation, the Flash doesn't attend his own second marriage, and his fiancee goes insane as a result of the presumed rejection.
Then he gets put on trial for the murder of Professor Zoom and, really, doesn't have much of a leg to stand on. Then a bunch of time travel shenanigans happened, Iris got brought back to life, Barry had his name cleared, and everything was good again! Right? Right? Yeah, sorry, wrong.
Because the final issue of The Flash solo series may have ended with Barry and Iris sharing a tender moment, but it was also thick with references to the speedy superheroes impending death. Living in the 30th century - where, it turns out, his first wife hails from - works out pretty well for the Allens for a little while. Certainly helps Barry beat the murder rap, living thousands of years in the future.
Except, a few weeks into their wedded, non-murdered bliss, Crisis On Infinite Earths had to happen. The fictional DC Universe has always been something of a mess, a tangled web of alternate realities and Earths that have housed many different versions of its key characters through the years.
The first Crisis was an attempt to tidy things up a little, whilst also providing an epic, blockbuster superhero story. Which also meant a lot of people died. It's the demise of Supergirl that often gets brought up - and used as the cover image on all subsequent reprint collections of the story - but Barry Allen's that was the most tragic. Having managed to make it through the most trying period of his superhero career, The Flash has finally found happiness - only to have it torn away from him. Undeterred, he vows to sort things out and return to his beloved. Which doesn't work out.
As the villainous Anti-Monitor releases a weapon that will destroy the whole universe it's Barry's intervention - sucking up all that bad mojo with the speed force - which saves everyone. It just kills him in the process. A heroic sacrifice, but a bloomin' upsetting one.