From 00c784a4d13021bcdc0f75fcd505ca984c0719e9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 20 Dec 2011 15:39:42 +0000 Subject: [PATCH] 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 --- src/osx/carbon/region.cpp | 3 +++ 1 file changed, 3 insertions(+) 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 ; }