Robin Williams’ widow says the actor was going through “chemical warfare in his brain” before his death.

Williams suffered from dementia caused by Lewy body disease and took his own life in August 2014.

Susan Schneider Williams writes in the medical journal Neurology that her husband’s suicide came “at the end of an intense, confusing and relatively swift persecution” from the disease.

She said Williams had trouble remembering lines during the filming of “Night at the Museum 3” in the spring of 2014 and that the “loss of memory and inability to control his anxiety was devastating to him.” Williams was diagnosed with Lewy body disease after his death.

Schneider Williams says she’s sharing her experience in the hope that doctors will be “inspired to turn Robin’s suffering into something meaningful.”