Quote:
Originally Posted by TheDarkWraith
Been trying to track down a really nasty bug for the last couple of days. I added code to give the ability to remove maps from a material. It all works perfect as long as there are still maps defined for the material. Once the number of maps = 0 the extendeddata for that material has to be replaced with new extendeddata. Everything works perfect until the file is saved. During saving there is some rogue pointer overwriting the offset for the material's new extendeddata - this causes the app to think the new extendeddata for the material is located somewhere else when the GR2 file is opened and read thus reading in incorrect data
|
Finally tracked down this bug. It was a nasty one! It all came down to duplicate pointers
The app created a few duplicate pointers when it cloned the extendeddata. I have since added code that checks pointers being removed to ensure they exist before deallocating space and code that checks to see if a pointer already exists before allocating space for it. Problem solved.
Now I just have to remedy some embedded string pointer corruption that happens when you elect to add the 'necessary' pointers