The shape evolutions of the pear-shaped nuclei 224 Ra and even-even 144−154 Ba with temperature are investigated by the finite-temperature relativistic mean field theory with the treatment of pairing correlations by the BCS approach. The free energy surfaces as well as the bulk properties including deformations, pairing gaps, excitation energy, and specific heat for the global minimum are studied. For 224 Ra, three discontinuities found in the specific heat curve indicate the pairing transition at temperature 0.4 MeV, and two shape transitions at temperatures 0.9 and 1.0 MeV, namely one from quadrupole-octupole deformed to quadrupole deformed, and the other from quadrupole deformed to spherical. Furthermore, the gaps at N =136 and Z =88 are responsible for stabilizing the octupole-deformed global minimum at low temperatures. Similar pairing transition at T ∼0.5MeV and shape transitions at T =0.5-2.2 MeV are found for even-even 144−154 Ba. The transition temperatures are roughly proportional to the corresponding deformations at the ground states.