diff --git a/doc/sphinx/cxx-guide/thermo.rst b/doc/sphinx/cxx-guide/thermo.rst index 0813c89e4..eb5d39893 100644 --- a/doc/sphinx/cxx-guide/thermo.rst +++ b/doc/sphinx/cxx-guide/thermo.rst @@ -18,7 +18,8 @@ prints its temperature is shown below: int main(int argc, char** argv) { - Cantera::ThermoPhase* gas = Cantera::newPhase("h2o2.cti","ohmech"); + std::unique_ptr gas( + Cantera::newPhase("h2o2.cti", "ohmech")); std::cout << gas->temperature() << std::endl; return 0; } diff --git a/doc/sphinx/cxx-guide/thermodemo.cpp b/doc/sphinx/cxx-guide/thermodemo.cpp index d92ec2a42..79d66fc7c 100644 --- a/doc/sphinx/cxx-guide/thermodemo.cpp +++ b/doc/sphinx/cxx-guide/thermodemo.cpp @@ -4,7 +4,7 @@ using namespace Cantera; void thermo_demo(const std::string& file, const std::string& phase) { - ThermoPhase* gas = newPhase(file, phase); + shared_ptr gas(newPhase(file, phase)); gas->setState_TPX(1500.0, 2.0*OneAtm, "O2:1.0, H2:3.0, AR:1.0"); // temperature, pressure, and density