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)