Calling DeleteObject on CBrush Object.

  • Thread starter Thread starter snabhi
  • Start date Start date
S

snabhi

Guest
void CTest::OnPaint()
{
CPaintDC dc(this);

CBrush brush(GetSysColor(COLOR_WINDOW));
dc.FillRect(&dc.m_ps.rcPaint, &brush);

.

.

.

}


Is it necessary to call brush.DeleteObject() at the end of OnPaint() event handler?

If I don't call, would it cause GDI handle leak?

Continue reading...
 
Back
Top