Well if the leak appears to be comming from the CreateCompatilbeDC,
my changes will have reduced the impact since we were doing some
pretty massive creation/deletion for DrawMine. I didn't even look
for a leak, though.
The code does have that pattern in several places. Which is causing it,
or are they all.
What about the fact that SelectObject can return the old handle? Could that
be your leak - handle to a resource?
In message "Re: Fwd: Memory leak in WineMine",
"Joshua Thielen" <[EMAIL PROTECTED]> writes:
>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
>
>
Ciao,
Peter Hunnisett
[EMAIL PROTECTED]