struct 里有指针 记得要重写构造函数和析构函数
struct ImageInfo
{
BITMAPINFO header;
void* image;
ImageInfo()
{
image = NULL;
}
~ImageInfo()
{
if(image!=NULL)
{
delete image;
image = NULL;
}
}
};
结果是当进入函数体就会实例化,而不是执行到它!
所以路途退出时,出会析构错误!呵呵
struct ImageInfo
{
BITMAPINFO header;
void* image;
ImageInfo()
{
image = NULL;
}
~ImageInfo()
{
if(image!=NULL)
{
delete image;
image = NULL;
}
}
};