Fixed illegal pointer use

This commit is contained in:
Hrvoje Jasak 2015-08-07 12:08:17 +01:00 committed by Dominik Christ
parent 078f96f805
commit 06d8b24ab5
3 changed files with 9 additions and 9 deletions

View file

@ -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());
}

View file

@ -54,10 +54,10 @@ class MeshedSurfaceIOAllocator
// Private data
//- Points
pointIOField points_;
pointIOField points_;
//- Faces
faceIOList faces_;
faceIOList faces_;
//- Surface zones
surfZoneIOList zones_;

View file

@ -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());
}