Fixed a memory leak error, due to faulty logic in
the destructor.
This commit is contained in:
parent
e3789e48e3
commit
47ef65b849
1 changed files with 5 additions and 2 deletions
|
|
@ -49,11 +49,13 @@ namespace Cantera {
|
|||
ThermoPhase::~ThermoPhase()
|
||||
{
|
||||
for (int k = 0; k < m_kk; k++) {
|
||||
if (!m_speciesData[k]) {
|
||||
if (m_speciesData[k]) {
|
||||
delete m_speciesData[k];
|
||||
m_speciesData[k] = 0;
|
||||
}
|
||||
}
|
||||
delete m_spthermo;
|
||||
m_spthermo = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -95,8 +97,9 @@ namespace Cantera {
|
|||
* We need to destruct first
|
||||
*/
|
||||
for (int k = 0; k < m_kk; k++) {
|
||||
if (!m_speciesData[k]) {
|
||||
if (m_speciesData[k]) {
|
||||
delete m_speciesData[k];
|
||||
m_speciesData[k] = 0;
|
||||
}
|
||||
}
|
||||
if (m_spthermo) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue