Heating of near-Earth objects and meteoroids due to close approaches to the Sun