From 90b0f5fced341db319fad931ae34eb1961e23f24 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Wed, 22 Nov 2006 19:54:38 +0000 Subject: [PATCH] Avoid crash when trying to access m_window from wxScreenDC. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dcclient.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mac/carbon/dcclient.cpp b/src/mac/carbon/dcclient.cpp index 9fcd763bb8..27164c2c9e 100644 --- a/src/mac/carbon/dcclient.cpp +++ b/src/mac/carbon/dcclient.cpp @@ -191,6 +191,11 @@ void wxWindowDC::DoGetSize( int* width, int* height ) const wxBitmap wxWindowDC::DoGetAsBitmap(const wxRect *subrect) const { + // wxScreenDC is derived from wxWindowDC, so a screen dc will + // call this method when a Blit is performed with it as a source. + if (!m_window) + return wxNullBitmap; + ControlRef handle = (ControlRef) m_window->GetHandle(); if ( !handle ) return wxNullBitmap; -- 2.45.2