A headteacher, who starred on TV show Come Dine with Me killed, killed himself after learning he was the centre of a police investigation over the possession of indecent images, an inquest has heard.
Huw Jones was found hanged in a churchyard in Lavernock, Vale of Glamorgan, on 1 February.
The 51-year-old had led Albert Road Primary School, in Penarth, for 12 years, but was suspended from his post just two days before his death.
Coroner Philip Spinney at Cardiff Coroners' Court concluded he took his own life after struggles with his sexuality.
The teacher appeared on the hit Channel 4 television series in 2011, where he prepared a meal of mushroom tart with duck egg, shoulder of lamb and poached pears.
The coroner heard that Jones was visited by officers from South Wales Police on 30 January at his Cardiff home with a search warrant to seize computer devices.
Detective Sergeant Emma Hampton told the court the force had earlier received information from South Yorkshire Police regarding indecent images, which implicated Jones.
Hampton said: "We introduced ourselves and explained we were at the address to introduce a warrant. When I asked him why he thought we might be at the property he said 'I like young chaps'.
"I cautioned Mr Jones and left him in the dining area while we were continuing a search. He seemed slightly nervous and drunk two glasses of water. He asked me if it was illegal to talk."
Officers took away electronic equipment but the teacher was not arrested.
However, prior to police coming to his home Jones attended a board of governors meeting at his school where he was told a safeguarding allegation had been raised and he could not return to work the following day.
Albert Road Primary School governors vice chair Jacquelyn Elias said in a statement: "At this time Huw went very red and started visibly shaking. He was deflated and went very quiet.
"It was the opposite of what we were expecting because he was an outgoing character. I expected him to provide an explanation that he had been hacked but he remained quiet."
Another statement, from assistant head teacher Gaynor Haldenby, was also read to the court.
She said: "Huw was gay but was struggling with this and was having relationships with younger men. Huw wanted to change his sexuality and said he didn't want to be having these relationships."
Jones was reported missing after failing to attend a further meeting with council officers. A toxicology report found that Jones's hanged body had large amounts of alcohol and paracetamol in his system.
Police found a note at his home addressed to his parents in which he said he was sorry for what he had done.