fixed destroyData so that it consistently removes the bounds from all modes

(this fixes a problem where a container returned to the app table free list was
retaining the bounds from its previous lifetime)
This commit is contained in:
Jeff Hill
2002-09-17 21:30:44 +00:00
parent 021e060853
commit c8d5854fcf

View File

@@ -181,24 +181,28 @@ inline gddStatus gdd::unreference(void) const
inline void gdd::destroyData(void)
{
if(destruct)
{
if(isContainer())
destruct->destroy(this);
else
destruct->destroy(dataPointer());
freeBounds(); // must be done here
destruct=NULL;
setData(NULL);
}
else if (isScalar())
if (isScalar())
{
//
// this destroys the string types
//
this->setPrimType (aitEnumInvalid);
}
else {
if(destruct)
{
if(isContainer())
destruct->destroy(this);
else
destruct->destroy(dataPointer());
destruct=NULL;
}
// required when prototype gdd goes
// back on app table free list
freeBounds();
memset ( & this->data, '\0', sizeof ( this->data ) );
}
}
inline void gdd::adjust(gddDestructor* d, void* v, aitEnum type,aitDataFormat)