mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
what has been allocated must be destroyed
new - delete malloc - free allocateArray - destroy Programming 101: Don't mix them!
This commit is contained in:
@ -147,11 +147,11 @@ species::species
|
||||
|
||||
species::~species()
|
||||
{
|
||||
delete partTemp_;
|
||||
delete partRho_;
|
||||
particleCloud_.dataExchangeM().destroy(partTemp_,1);
|
||||
particleCloud_.dataExchangeM().destroy(partRho_,1);
|
||||
|
||||
for (int i=0; i<speciesNames_.size();i++) delete [] concentrations_[i];
|
||||
for (int i=0; i<speciesNames_.size();i++) delete [] changeOfSpeciesMass_[i];
|
||||
for (int i=0; i<speciesNames_.size();i++) particleCloud_.dataExchangeM().destroy(concentrations_[i],1);
|
||||
for (int i=0; i<speciesNames_.size();i++) particleCloud_.dataExchangeM().destroy(changeOfSpeciesMass_[i],1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -155,10 +155,10 @@ heatTransferGunn::heatTransferGunn
|
||||
|
||||
heatTransferGunn::~heatTransferGunn()
|
||||
{
|
||||
delete partTemp_;
|
||||
delete partHeatFlux_;
|
||||
delete partRe_;
|
||||
delete partNu_;
|
||||
particleCloud_.dataExchangeM().destroy(partTemp_,1);
|
||||
particleCloud_.dataExchangeM().destroy(partHeatFlux_,1);
|
||||
particleCloud_.dataExchangeM().destroy(partRe_,1);
|
||||
particleCloud_.dataExchangeM().destroy(partNu_,1);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -68,7 +68,7 @@ heatTransferGunnImplicit::heatTransferGunnImplicit
|
||||
|
||||
heatTransferGunnImplicit::~heatTransferGunnImplicit()
|
||||
{
|
||||
delete partHeatFluxCoeff_;
|
||||
particleCloud_.dataExchangeM().destroy(partHeatFluxCoeff_,1);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -77,7 +77,7 @@ reactionHeat::reactionHeat
|
||||
|
||||
reactionHeat::~reactionHeat()
|
||||
{
|
||||
delete reactionHeat_;
|
||||
particleCloud_.dataExchangeM().destroy(reactionHeat_,1);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -120,8 +120,8 @@ KochHillRWDrag::KochHillRWDrag
|
||||
|
||||
KochHillRWDrag::~KochHillRWDrag()
|
||||
{
|
||||
delete partTime_;
|
||||
delete partUfluct_;
|
||||
particleCloud_.dataExchangeM().destroy(partTime_, 1);
|
||||
particleCloud_.dataExchangeM().destroy(partUfluct_, 3);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -105,8 +105,8 @@ LaEuScalarTemp::LaEuScalarTemp
|
||||
|
||||
LaEuScalarTemp::~LaEuScalarTemp()
|
||||
{
|
||||
delete partTemp_;
|
||||
delete partHeatFlux_;
|
||||
particleCloud_.dataExchangeM().destroy(partTemp_,1);
|
||||
particleCloud_.dataExchangeM().destroy(partHeatFlux_,1);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -113,8 +113,8 @@ dSauter::dSauter
|
||||
|
||||
dSauter::~dSauter()
|
||||
{
|
||||
delete d2_;
|
||||
delete d3_;
|
||||
particleCloud_.dataExchangeM().destroy(d2_,1);
|
||||
particleCloud_.dataExchangeM().destroy(d3_,1);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -82,7 +82,7 @@ granKineticEnergy::granKineticEnergy
|
||||
|
||||
granKineticEnergy::~granKineticEnergy()
|
||||
{
|
||||
delete vfluc_;
|
||||
particleCloud_.dataExchangeM().destroy(vfluc_,1);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -119,7 +119,7 @@ virtualMassForce::virtualMassForce
|
||||
|
||||
virtualMassForce::~virtualMassForce()
|
||||
{
|
||||
delete UrelOld_;
|
||||
particleCloud_.dataExchangeM().destroy(UrelOld_,3);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -83,8 +83,8 @@ regionModel::regionModel
|
||||
|
||||
regionModel::~regionModel()
|
||||
{
|
||||
free(inRegion_);
|
||||
free(outRegion_);
|
||||
particleCloud_.dataExchangeM().destroy(inRegion_,1);
|
||||
particleCloud_.dataExchangeM().destroy(outRegion_,1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user