Original Post
memory leak problems
Whats types of code can give a memory leak ?
Whats the best way to find a memory leaks if you have lots and lots of code and it's not even your code how do you find them?
line by line?
windows gdi+ has given me some problems can you see the leak?
const int BMAP=80;
const int BREC=BMAP*BMAP;
long deltaX =BMAP*20;
long deltaY =BMAP*20;
static RECT rctGrid; // grid-window rectangle
static RECT rect[BREC]; // grid-cell array
HRGN hrgnCell; // test-region handle
HDC hdc; // device context (DC) handle
float x, y; // drawing coordinates
POINTS ptlHit; // mouse coordinates
int i; // count variable
PAINTSTRUCT ps;
hdc = GetDC(hdlg);
Graphics* myGraphics;
Pen* pen;
pen = new Pen(Color(255-LC.A,LC.R,LC.G,LC.B), 1);
myGraphics = new Graphics(hdc);
SolidBrush solidBrush(Color());
//lots of stuff
//releaseing and deleteing
ReleaseDC(hdlg, hdc);
delete myGraphics;
delete pen;
DeleteObject(hrgnCell);
this code is called several times a secound.
I lose a megabit every 3 seconds times.
what's leaking?
[edited by - markdezonia on November 1, 2002 7:08:53 AM]