From 89ef594505b1c1634d38db388a59eb45eb85b3b0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 20 Nov 2013 12:01:31 +0000 Subject: [PATCH] Fix wxRegion::Offset() copy on write behaviour in wxMSW. Offset the correct, new and unshared, region handle instead of the old and possibly shared one. Closes #15690. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75251 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/region.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/msw/region.cpp b/src/msw/region.cpp index d8523a072f..846fff1e85 100644 --- a/src/msw/region.cpp +++ b/src/msw/region.cpp @@ -164,8 +164,7 @@ void wxRegion::Clear() bool wxRegion::DoOffset(wxCoord x, wxCoord y) { - const HRGN hrgn = GetHrgn(); - wxCHECK_MSG( hrgn, false, wxT("invalid wxRegion") ); + wxCHECK_MSG( GetHrgn(), false, wxT("invalid wxRegion") ); if ( !x && !y ) { @@ -175,7 +174,7 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y) AllocExclusive(); - if ( ::OffsetRgn(hrgn, x, y) == ERROR ) + if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR ) { wxLogLastError(wxT("OffsetRgn"));