From 4e6205fa8c9fc318976e6f1ee4ef653130e76d33 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 12 Dec 2014 01:36:48 +0000 Subject: [PATCH] Eliminate memory leak in demoequil.cpp --- doc/sphinx/cxx-guide/demoequil.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/sphinx/cxx-guide/demoequil.cpp b/doc/sphinx/cxx-guide/demoequil.cpp index 4688c2959..f99707fc5 100644 --- a/doc/sphinx/cxx-guide/demoequil.cpp +++ b/doc/sphinx/cxx-guide/demoequil.cpp @@ -4,7 +4,7 @@ using namespace Cantera; void equil_demo() { - ThermoPhase* gas = newPhase("h2o2.cti","ohmech"); + std::auto_ptr gas(newPhase("h2o2.cti","ohmech")); gas->setState_TPX(1500.0, 2.0*OneAtm, "O2:1.0, H2:3.0, AR:1.0"); gas->equilibrate("TP"); std::cout << gas->report() << std::endl; @@ -19,4 +19,3 @@ int main() std::cout << err.what() << std::endl; } } -