  The thermal corrections to the propagator of a loosely bound charm-meson
molecule in a pion gas are calculated to next-to-leading order in the
heavy-meson expansion using a zero-range effective field theory. Ultraviolet
divergences in the charm-meson-pair self energy are canceled by corrections to
the charm-meson-pair contact vertex. Terms that are singular at the
charm-meson-pair threshold can be absorbed into thermal corrections to the rest
energies and kinetic masses of the charm-meson constituents. The remaining
terms reduce to a thermal correction to the binding momentum that is
proportional to the pion number density and suppressed by the pion/charm-meson
mass ratio. The correction gives a tiny decrease in the binding energy of the
charm-meson molecule relative to the charm-meson-pair threshold in the pion gas
and a change in its thermal width that is small compared to the thermal widths
of the charm-meson constituents. These results are encouraging for the
prospects of observing $X(3872)$ and $T_{cc}^+(3875)$ in the expanding hadron
gas produced by heavy-ion collisions.
