From c8d5854fcf3b578204054af32bf18836c7d0f986 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 17 Sep 2002 21:30:44 +0000 Subject: [PATCH] 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) --- src/gdd/gddI.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/gdd/gddI.h b/src/gdd/gddI.h index cea1fae49..aa58062b1 100644 --- a/src/gdd/gddI.h +++ b/src/gdd/gddI.h @@ -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)