Alan Turing was a British mathematician who lived from June 23, 1912 to June 7, 1954. He played a prominent role in World War 2 for the Allies, he decoded special "Enigma" morse code transmissions from the Axis powers, they believed it helped the Allies win WW2.
In 1941 he married his colleague Joan Clarke, but the marriage didn't last, after he admitted his homosexuality to her, he decided he could not go through the marriage. (Pages 176-178, "The Man Who Knew Too Much" by David Leavitt) She was apparently unfazed by the revelation. At the time male homosexual acts were illegal in Britain.
In January 1952, Turing entered a relationship with an unemployed 19 year old named Arnold Murray, Arnold spent the night with Alan, Alan was then robbed by an acquaintance of Arnold, and in the process of investigation, Alan admitted he was homosexual. He was charged with "gross indecency", he was later convicted and given the choice of probation and chemical castration, or prison. He chose probation. The castration caused him to become impotent.
On June 8th, 1954 he was found dead, from cyanide poisoning. The official verdict was suicide, but no motive was established.