During the course of The Terror Dr. Stanley is depicted as a largely arrogant and uninterested person without much emotional connection to either the expedition or the rest of the crew.
When Mr. Goodsir tells him about the lead poisoning from the canned provisions, he decides to not yet tell anyone about it (or simply didn't take Mr. Goodsir all too serious, like the rest of the time). When one of the crew members tells him about his depressions, he tells him not to worry about it too much and to enjoy the upcoming carneval as a distraction.
But then during the carneval in the episode "A Mercy" (S01E06), he suddenly sets fire to the entire camp and ultimately to himself, dying in the process and taking many crew members with him. This came entirely out of the blue to me for his character and I wonder what happened to him and why he completely lost it all of a sudden. Did he just despair at the situation they were in? Was there any kind of foreshadowing of this development of him that I might have missed?