From: Vadim Zeitlin Date: Tue, 20 Dec 2011 15:39:42 +0000 (+0000) Subject: Fix crash in wxRegion in wxOSX/Carbon. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/00c784a4d13021bcdc0f75fcd505ca984c0719e9 Fix crash in wxRegion in wxOSX/Carbon. Apparently some code expects to be able to call wxRegion::GetWXHRGN() even on an invalid wxRegion. Return NULL in this case instead of crashing. This fixes crash on startup of the widgets sample. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/osx/carbon/region.cpp b/src/osx/carbon/region.cpp index 83a2e15e12..8db684def8 100644 --- a/src/osx/carbon/region.cpp +++ b/src/osx/carbon/region.cpp @@ -309,6 +309,9 @@ bool wxRegion::IsEmpty() const WXHRGN wxRegion::GetWXHRGN() const { + if ( !m_refData ) + return NULL; + return M_REGION ; }