Original Post
Hi all.
I have had a number of blue screens trying to collect garbage from two linked lists with structs.
The structs are:
struct BMP
{
BITMAPFILEHEADER m_BMPHead;
BITMAPINFOHEADER m_BMPInfo;
RGBQUAD m_Palette[BMP_COLORS];
BYTE *m_Image;
BMP *m_lpNext;
BMP *m_lpPrev;
};
and
struct SurfList
{
LPDIRECTDRAWSURFACE7 m_lpSurface;
SurfList *m_lpNext;
SurfList *m_lpPrev;
};
1. These are in linked lists. To clear the lists I loop through them keeping a ptr on the current and next. Would:
delete lpBMP; and
delete lpSurflist
delete each of these structs, including the *m_image array?
2. How about the RGBQUAD does it get deleted? delete[] &m_Palette cause blue screen.
3. When releasing a primary surface, does the palette get cleared out as well (8 bit)?
I currently delete the BMP in a loop like so (lpCurrent=*struct):
delete[] lpCurrent->m_Image;
lpCurrent->m_lpNext=0;
lpCurrent->m_lpPrev=0;
delete lpCurrent;
Lets here the experts.
Edited by - clabinsky on December 22, 2001 12:18:28 AM