/* * Free memory associated with bitmap structure. */ void BitmapsFree(Bitmaps *b) { int i; // First free individual bitmaps, if they have been loaded for (i=0; i < b->num_bitmaps; i++) if (b->pdibs[i] != NULL) DibFree(b->pdibs[i]); SafeFree(b->pdibs); }
void CloseBBG(void) { int i; PDIB pdib; HWND hList; if (NumBBGs == 0) return; if (BBGs[CurrentBBG].changed && MessageBox(hMain, "This BBG has changed; are you sure you want to close it?", "Confirm BBG close", MB_YESNO) == IDNO) return; hList = GetDlgItem(hMain, IDBBGLIST); // Free bitmaps for (i=0; i < BBGs[CurrentBBG].NumBitmaps; i++) { pdib = BBGs[CurrentBBG].Bitmaps[i].pdib; if (pdib != NULL) DibFree(pdib); } NumBBGs--; for (i = CurrentBBG; i < NumBBGs; i++) BBGs[i] = BBGs[i + 1]; CurrentBBG = ListBoxRemoveCurrentItem(hList); if (CurrentBBG == -1) CurrentBBG = 0; FillBitmapList(); FillHotlist(); FillGroupList(); FillGroupiesList(); WanderOne.BBG = -1; Anchor.BBG = -1; SetDlgItemText(hMain, ANCHORTEXT, " "); SetDlgItemText(hMain, WANDER1TEXT, " "); DrawIt(); }
CFloodFill2::~CFloodFill2() { if (m_bCopy) DibFree(m_pDib); m_pDib = NULL; }