bool wxRegion::DoOffset(wxCoord x, wxCoord y)
{
- wxCHECK_MSG( M_REGION, false, wxT("invalid wxRegion") );
+ const HRGN hrgn = GetHrgn();
+ wxCHECK_MSG( hrgn, false, wxT("invalid wxRegion") );
if ( !x && !y )
{
AllocExclusive();
- if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR )
+ if ( ::OffsetRgn(hrgn, x, y) == ERROR )
{
wxLogLastError(wxT("OffsetRgn"));
m_current = 0;
m_region = region;
- if (m_rects)
- {
- delete[] m_rects;
-
- m_rects = NULL;
- }
+ wxDELETEA(m_rects);
if (m_region.Empty())
m_numRects = 0;