Added extra check to make sure that _userDataContainer was available before copying it
This commit is contained in:
parent
52e3f300e8
commit
deed0a89fe
@ -24,13 +24,16 @@ Object::Object(const Object& obj,const CopyOp& copyop):
|
||||
_name(obj._name),
|
||||
_dataVariance(obj._dataVariance)
|
||||
{
|
||||
if (copyop.getCopyFlags()&osg::CopyOp::DEEP_COPY_USERDATA)
|
||||
if (obj._userDataContainer.valid())
|
||||
{
|
||||
_userDataContainer = new UserDataContainer(*obj._userDataContainer, copyop);
|
||||
}
|
||||
else
|
||||
{
|
||||
_userDataContainer = obj._userDataContainer;
|
||||
if (copyop.getCopyFlags()&osg::CopyOp::DEEP_COPY_USERDATA)
|
||||
{
|
||||
_userDataContainer = new UserDataContainer(*obj._userDataContainer, copyop);
|
||||
}
|
||||
else
|
||||
{
|
||||
_userDataContainer = obj._userDataContainer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user