NEW YORK — An old picture of Roseanne Barr dressed as Adolf Hitler, wearing a swastika and pulling burnt cookies from an oven, splashed on the front of the New York Daily News Wednesday like a neon sign asking ABC executives: What were you thinking?

Given Barr's past incidents of bad behavior and questionable social media posts, ABC faced questions Wednesday about why it went back into business with her before it all blew apart. ABC canceled its successful reboot of "Roseanne" on Tuesday following the star's racist tweet likening former Obama adviser Valerie Jarrett to a cross between the Muslim Brotherhood and a "Planet of the Apes" actor.

Barr continued tweeting on Wednesday, at one point saying the offending tweet was composed at 2 a.m. after she took the insomnia drug Ambien. That led the drug maker Sanofi to say on social media that "racism is not a known side effect" of their product.

President Donald Trump, noting in a tweet that Robert Iger, CEO of ABC's parent Walt Disney Co., had called Jarrett to apologize, wondered why ABC hadn't apologized for "HORRIBLE statements made and said about me on ABC."

On social media, Barr wrote that what she said was indefensible, then retweeted several statements others made supporting her. She apologized to those who had lost their jobs because of her action, but also condemned cast members who threw her under the bus, in her words.

"I'm not a racist, I never was & I never will be," she wrote Wednesday. "One stupid joke in a lifetime of fighting 4 civil rights 4 all minorities, against networks, studios, at the expense of my nervous system/family/wealth will NEVER be taken from me."

Jordan Strauss/Invision/AP

FILE - In this March 23, 2018, file photo, Roseanne Barr arrives at the Los Angeles premiere of "Roseanne" on Friday in Burbank, Calif.

Yet many saw a disturbing pattern being followed instead of a joke. Questionable actions date back to a cringe-worthy, crotch-grabbing rendition of the national anthem in 1990; a claim, later recanted, that she was an incest survivor; and the 2009 picture reprinted on the Daily News. Her social media past includes a racist tweet about former national security adviser Susan Rice and support for conspiracy theories like "pizzagate." On the same night as her Jarrett tweet, she posted a false claim about Chelsea Clinton that Clinton refuted.

ABC executives were not discussing their thought processes on Wednesday. It's clear, though, that Barr's social media habits were a sore point. She told USA Today earlier this year that "I had to get off social media because everybody's mad at me." In an Adweek article published only 10 days ago, she promised only to talk about what she's for, and not what she's against, when tweeting.

"Roseanne has said herself that she does not want what she says to overshadow the show in any way, and I do hope that she will continue to be thoughtful about what she shares on social media going forward," ABC Entertainment President Channing Dungey said in the same article.

Was ABC's gamble worth the risk to its reputation?

Opinion writer Roxane Gay wrote in The New York Times Wednesday that ABC did the right in canceling "Roseanne." ''But before it did the right thing, it did the wrong thing," she wrote.

"Everyone involved made a decision to support the show despite its co-creator's racism," Gay wrote. "They decided that their career ambitions, or desire to return to network television, or financial interests would best be served by looking the other way. It was only when Ms. Barr became an immediate liability that everyone involved finally looked at her racism and dealt with it directly."

ABC executives talked shortly after the 2016 election about a need to have more on the network schedule to reflect the point of view that got Trump elected. When Sara Gilbert began rounding up the old "Roseanne" cast for a reunion in early 2017, ABC fought Netflix for the rights to show it. The network — indeed all of broadcast television — needed some successful comedies.

The rebooted "Roseanne," where Barr played a Trump supporter, worked beyond anyone's dreams — logging 25 million viewers for its premiere in March and settling in as television's second most popular comedy after "The Big Bang Theory."

"I tend to be pretty forgiving to people who feel they can get a good show out there and keep the star in check, and you usually can, because a lot of stars can be problematic," said Garth Ancier, a veteran television executive who ran entertainment programming at Fox, NBC and the WB networks.

"I think it was a reasonable bet to take, and it worked until it didn't," Ancier said.

Ted Harbert knows better than most what Dungey and her boss, Ben Sherwood, went through. He was ABC's top programming executive during the first run of "Roseanne" in the 1990s. Barr was his headache then; he recalled having to go to her home where she was holed up with Tom Arnold for a few weeks and refusing to work in 1994, and coax her out.

"This is a person who, left to her own devices, is not totally in control," Harbert said. She has the temperament, and the tendency to go to dark places, that fuels many artists, he said.

Social media complicates the efforts of networks to keep stars working and things running smoothly, he said.

"How do you stop someone who does something like this in the middle of the night?" he said. "She blows up her own life and that of all those around her."

If he were in Dungey's position when the rebooted "Roseanne" was being considered — mindful that his job is to produce hits, or it won't be his job much longer — Harbert said he probably would have taken several meetings with Barr to figure out how she was doing. He probably would have made the same decision ABC made, he said.

Both former executives praised ABC for moving swiftly when presented with Barr's tweet. Ancier said ABC probably had a plan in place for that eventuality, given how quickly the show was erased from network web sites.

"A lot of comics say terrible things," Harbert said. "As long as they make us laugh, it's easy to forgive. What Roseanne said was not funny."

After an all-night special session, both houses of the Legislature adjourned just before 7 a.m. after a series of votes on the next two years of state spending. But there was no deal on a public works borrowing bill, which will wait until next year.