Commit 822019bb authored by Andrew Heather's avatar Andrew Heather
Browse files

assign pointers to NULL after deletion

parent a8f7488e
......@@ -127,6 +127,7 @@ void Foam::particleForces::cacheFields(const bool store)
if (gradUPtr_)
{
delete gradUPtr_;
gradUPtr_ = NULL;
}
}
}
......
......@@ -95,11 +95,13 @@ void Foam::DispersionRASModel<CloudType>::cacheFields(const bool store)
if (ownK_ && kPtr_)
{
delete kPtr_;
kPtr_ = NULL;
ownK_ = false;
}
if (ownEpsilon_ && epsilonPtr_)
{
delete epsilonPtr_;
epsilonPtr_ = NULL;
ownEpsilon_ = false;
}
}
......
......@@ -72,6 +72,7 @@ void Foam::GradientDispersionRAS<CloudType>::cacheFields(const bool store)
if (gradkPtr_)
{
delete gradkPtr_;
gradkPtr_ = NULL;
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment