请问这个函数为什么会泄露内存,应该怎么改?
void MyFrame::MyFillRect(){
CBrush brushb(RGB(228,228,228));
int m_breakpoint;
CDC* hdc;
hdc = GetWindowDC();
CRect rect;
GetClientRect(&rect);
hdc->FillRect (CRect(rect.left+2 ,rect.top+2 ,rect.left + 30,rect.Height ()+2),&brushb);//画底色
brushb.DeleteObject ();
}
每调一次内存就长一点,降不下来了.
谢谢!