X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..3eabbbcc5d6a3dc2395a48eeed3da4bc894f644b:/src/msw/region.cpp?ds=sidebyside diff --git a/src/msw/region.cpp b/src/msw/region.cpp index 73d983df89..fece55e9c5 100644 --- a/src/msw/region.cpp +++ b/src/msw/region.cpp @@ -165,7 +165,8 @@ void wxRegion::Clear() 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 ) { @@ -175,7 +176,7 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y) AllocExclusive(); - if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR ) + if ( ::OffsetRgn(hrgn, x, y) == ERROR ) { wxLogLastError(wxT("OffsetRgn")); @@ -384,12 +385,7 @@ void wxRegionIterator::Reset(const wxRegion& region) 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;