Fixed illegal pointer use
This commit is contained in:
parent
078f96f805
commit
06d8b24ab5
3 changed files with 9 additions and 9 deletions
|
@ -87,16 +87,16 @@ void Foam::MeshedSurfaceIOAllocator::clear()
|
|||
|
||||
void Foam::MeshedSurfaceIOAllocator::resetFaces
|
||||
(
|
||||
const Xfer< List<face> >& faces,
|
||||
const Xfer< surfZoneList >& zones
|
||||
const Xfer<List<face> >& faces,
|
||||
const Xfer<surfZoneList>& zones
|
||||
)
|
||||
{
|
||||
if (&faces)
|
||||
if (!faces().empty())
|
||||
{
|
||||
faces_.transfer(faces());
|
||||
}
|
||||
|
||||
if (&zones)
|
||||
if (!zones().empty())
|
||||
{
|
||||
zones_.transfer(zones());
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ void Foam::MeshedSurfaceIOAllocator::reset
|
|||
{
|
||||
// Take over new primitive data.
|
||||
// Optimized to avoid overwriting data at all
|
||||
if (&points)
|
||||
if (!points().empty())
|
||||
{
|
||||
points_.transfer(points());
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ void Foam::MeshedSurfaceIOAllocator::reset
|
|||
{
|
||||
// Take over new primitive data.
|
||||
// Optimized to avoid overwriting data at all
|
||||
if (&points)
|
||||
if (!points().empty())
|
||||
{
|
||||
points_.transfer(points());
|
||||
}
|
||||
|
|
|
@ -54,10 +54,10 @@ class MeshedSurfaceIOAllocator
|
|||
// Private data
|
||||
|
||||
//- Points
|
||||
pointIOField points_;
|
||||
pointIOField points_;
|
||||
|
||||
//- Faces
|
||||
faceIOList faces_;
|
||||
faceIOList faces_;
|
||||
|
||||
//- Surface zones
|
||||
surfZoneIOList zones_;
|
||||
|
|
|
@ -207,7 +207,7 @@ Foam::surfMesh::surfMesh
|
|||
}
|
||||
|
||||
// We can also send Xfer<..>::null just to initialize without allocating
|
||||
if (&surf)
|
||||
if (!surf().empty())
|
||||
{
|
||||
transfer(surf());
|
||||
}
|
||||
|
|
Reference in a new issue