After checking out the memory leak, I think I've narrowed it down to this code
snippet:

---in main.c---
 hMemDC = CreateCompatibleDC( hdc );
 SelectObject (hMemDC, p_board->hMinesBMP);

 BitBlt( hdc,
     (col - 1) * MINE_WIDTH + p_board->mines_rect.left,
     (row - 1) * MINE_HEIGHT + p_board->mines_rect.top,
     MINE_WIDTH, MINE_HEIGHT,
     hMemDC, 0, offset * MINE_HEIGHT, SRCCOPY);

 DeleteDC( hMemDC );
------

Am I doing anything incorrect here?

After commenting out various parts, I believe the leak occurs in
CreateCompatibleDC or DeleteDC, but I could not find any bugs in these
functions. Actually, I did notice that origDC never gets unlocked in
CreateCompatibleDC, is this a bug? Unlocking this does not stop the memory
leak in winemine, however.

Joshua Thielen

_____________________________________________
NetZero - Defenders of the Free World
Click here for FREE Internet Access and Email
http://www.netzero.net/download/index.html

Reply via email to