From 7c615c952981c33753fcf86e6d6c13ec8643c9d2 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Mon, 8 Sep 2008 22:04:27 +0000 Subject: [PATCH] Fixed a umr in the VPSSMgr_Water_HKFT.h module. --- Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp | 2 -- Cantera/src/thermo/VPSSMgr_Water_ConstVol.h | 3 +-- Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp | 12 +++--------- Cantera/src/thermo/VPSSMgr_Water_HKFT.h | 2 +- Cantera/src/thermo/VPStandardStateTP.cpp | 2 +- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp index f1980f899..4e004714a 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp +++ b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.cpp @@ -62,7 +62,6 @@ namespace Cantera { { if (&b == this) return *this; VPSSMgr::operator=(b); - //if (m_waterSS) delete m_waterSS; return *this; } @@ -208,7 +207,6 @@ namespace Cantera { const vector&sss = m_vptp_ptr->speciesNames(); - m_waterSS = dynamic_cast(m_vptp_ptr->providePDSS(0)); if (!m_waterSS) { throw CanteraError("VPSSMgr_Water_ConstVol::initThermoXML", "bad dynamic cast"); diff --git a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h index 70400746f..5ac4c7543 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h +++ b/Cantera/src/thermo/VPSSMgr_Water_ConstVol.h @@ -293,8 +293,7 @@ namespace Cantera { */ virtual void initAllPtrs(VPStandardStateTP *vp_ptr, SpeciesThermo *sp_ptr); - protected: - + private: //! Pointer to the Water PDSS object. /*! diff --git a/Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp b/Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp index 9d541688d..c13cfdc50 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp +++ b/Cantera/src/thermo/VPSSMgr_Water_HKFT.cpp @@ -41,7 +41,6 @@ namespace Cantera { { m_useTmpRefStateStorage = true; m_useTmpStandardStateStorage = true; - m_waterSS = new PDSS_Water(); } @@ -51,11 +50,11 @@ namespace Cantera { } VPSSMgr_Water_HKFT::VPSSMgr_Water_HKFT(const VPSSMgr_Water_HKFT &right) : - VPSSMgr(right.m_vptp_ptr, right.m_spthermo) + VPSSMgr(right.m_vptp_ptr, right.m_spthermo), + m_waterSS(0) { m_useTmpRefStateStorage = true; m_useTmpStandardStateStorage = true; - m_waterSS = new PDSS_Water(); *this = right; } @@ -65,8 +64,7 @@ namespace Cantera { { if (&b == this) return *this; VPSSMgr::operator=(b); - if (m_waterSS) delete m_waterSS; - m_waterSS = new PDSS_Water(*(b.m_waterSS)); + m_waterSS = (PDSS_Water *) m_vptp_ptr->providePDSS(0); return *this; } @@ -76,7 +74,6 @@ namespace Cantera { return (VPSSMgr *) vpm; } - void VPSSMgr_Water_HKFT::getEnthalpy_RT_ref(doublereal *hrt) const{ // Everything should be OK except for the water SS @@ -211,8 +208,6 @@ namespace Cantera { &phaseNode.root()); const vector&sss = m_vptp_ptr->speciesNames(); - if (m_waterSS) delete m_waterSS; - m_waterSS = new PDSS_Water(m_vptp_ptr, 0); m_waterSS->setState_TP(300., OneAtm); m_Vss[0] = (m_waterSS->density()) / m_vptp_ptr->molecularWeight(0); @@ -232,7 +227,6 @@ namespace Cantera { throw CanteraError("VPSSMgr_Water_HKFT::initThermoXML", "standardState model for species isn't hkft: " + s->name()); } - // m_Vss[k] = getFloat(*ss, "molarVolume", "-"); } } diff --git a/Cantera/src/thermo/VPSSMgr_Water_HKFT.h b/Cantera/src/thermo/VPSSMgr_Water_HKFT.h index a563df566..a174c78b8 100644 --- a/Cantera/src/thermo/VPSSMgr_Water_HKFT.h +++ b/Cantera/src/thermo/VPSSMgr_Water_HKFT.h @@ -321,7 +321,7 @@ namespace Cantera { //@} - protected: + private: //! Shallow pointer to the water object PDSS_Water *m_waterSS; diff --git a/Cantera/src/thermo/VPStandardStateTP.cpp b/Cantera/src/thermo/VPStandardStateTP.cpp index 7e06fa07d..164eb3f12 100644 --- a/Cantera/src/thermo/VPStandardStateTP.cpp +++ b/Cantera/src/thermo/VPStandardStateTP.cpp @@ -378,7 +378,7 @@ namespace Cantera { if (m_PDSS_storage[k] != 0) { delete m_PDSS_storage[k] ; } - m_PDSS_storage[k] = m_VPSS_ptr->createInstallPDSS(k, s, phaseNode_ptr); + m_PDSS_storage[k] = m_VPSS_ptr->createInstallPDSS(k, s, phaseNode_ptr); } PDSS *