Samson willingly sacrificed his own life to take out the Philistine aristocracy, asking God to take his life along with his enemies, not out of despair. Quite a different scenario than someone just being bummed with life and deciding it was a good day to end it.
The equivalent for Samson would have been to take his own life while still in his prison cell.