Skip to content
Snippets Groups Projects
Commit 11176914 authored by mattijs's avatar mattijs
Browse files

memory leak

parent 01fbf98d
Branches
Tags
No related merge requests found
......@@ -81,17 +81,20 @@ Foam::phaseModel::phaseModel
{
Info<< "Reading face flux field " << phiName << endl;
phiPtr_ = new surfaceScalarField
phiPtr_.reset
(
IOobject
new surfaceScalarField
(
phiName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
IOobject
(
phiName,
mesh.time().timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
)
);
}
else
......@@ -112,18 +115,21 @@ Foam::phaseModel::phaseModel
}
}
phiPtr_ = new surfaceScalarField
phiPtr_.reset
(
IOobject
new surfaceScalarField
(
phiName,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::interpolate(U_) & mesh.Sf(),
phiTypes
IOobject
(
phiName,
mesh.time().timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
fvc::interpolate(U_) & mesh.Sf(),
phiTypes
)
);
}
}
......
......@@ -69,7 +69,7 @@ class phaseModel
volVectorField U_;
//- Fluxes
surfaceScalarField* phiPtr_;
autoPtr<surfaceScalarField> phiPtr_;
public:
......@@ -133,12 +133,12 @@ public:
const surfaceScalarField& phi() const
{
return *phiPtr_;
return phiPtr_();
}
surfaceScalarField& phi()
{
return *phiPtr_;
return phiPtr_();
}
};
......
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