Original Post
can anyone help with this ?
class cImage
{
cImage();
virtual ~cImage();
......
unsigned char* mImageData;
};
class cTGAImage : public cImage
{
cTGAImage();
~cTGAImage( delete mImageData );
........
};
class cTexture
{
~cTexture( delete mImage; }
........
cImage* mImage;
};
then in my code...I create the a cTexture object, then create the cImage object and use member functions in the cTGAImage class to load the tga. The tga loads and works fine. My problem is when I try to delete the cTexture object...in the destructor of the cTGAImage, I get a debug assertion when I try to delete mImageData. I don''t understand why this should be, the pointer is valid because I''ve got an ASSERT there.