LOS ANGELES — “The Big Bang Theory” star Johnny Galecki is thanking firefighters for trying in vain to save his vacation home from a California wildfire.

Galecki posted a picture on Instagram on Thursday of himself hugging a firefighter while standing among the rubble of the home in the San Luis Obispo area.

He thanked Cal Fire in the caption, adding: “It is the profound risks that you accept and the sacrifices you and your families make that keep us safe.”

The 42-year-old Galecki plays Dr. Leonard Hofstadter on the CBS show, one of the most popular on TV. He also was a regular on the ABC sitcom “Roseanne.”