The ex-partner of comedian Matt Lucas was battling drug addiction when he apparently killed himself, it has been reported.

Kevin McGee was reportedly found hanged in his Edinburgh flat after posting a message on Facebook that said: “Kevin McGee thinks death is much better than life.”

Despite undergoing treatment at a rehab clinic last summer paid for by Little Britain star Matt, McGee was unable to kick a cocaine habit, The Sun newspaper reported.

Lucas withdrew from a West End role as a suicidal writer following the news of his former boyfriend’s death.

He played Kenneth Halliwell in Prick Up Your Ears, which ends as Halliwell murders his lover Joe Orton and prepares to take his own life.

A statement from the producers of the play, which is being staged at The Comedy Theatre in central London, said: “Our thoughts are with Matt whom we are in constant touch with.

“Until further notice, his role of Kenneth Halliwell in the West End production of Prick Up Your Ears will be played by his understudy, Michael Chadwick.”

Police found Mr McGee’s body at his flat after they broke in at 8am.

The television producer, who married Matt, 35, in a civil partnership ceremony in December 2006, had posted his message on Facebook three hours earlier.

He previously worked for London-based production company Carbon Media.