Margaret Cho's ex-boyfriend lost it when she dumped him, and resorted to sending her menacing social media threats ... according to legal docs the comedian filed.
Margaret claims she broke up with David Moraga back in May after nearly 2 years because he was "severely controlling and abusive." She says he refused to accept the breakup, and wouldn't move out of her home ... so she evicted him and changed the locks.
In the docs, she says Moraga undeterred and broke into the house, changed the locks again and barricaded himself inside. That same week, she says he posted a pic of her lying on the ground with the caption, "When You're Dead, You're Dead."
Margaret went to court seeking a temporary restraining order, fearing David would physically harm her. The judge agreed and ordered him to stay 100 yards away, and to stop posting threatening or derogatory pics or statements.