]> git.saurik.com Git - wxWidgets.git/commitdiff
Avoid crash when trying to access m_window from wxScreenDC.
authorKevin Ollivier <kevino@theolliviers.com>
Wed, 22 Nov 2006 19:54:38 +0000 (19:54 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Wed, 22 Nov 2006 19:54:38 +0000 (19:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43605 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dcclient.cpp

index 9fcd763bb8548e9ee2f607705d9328fa28b777d7..27164c2c9ec538bee99c931a48e521664feacdb5 100644 (file)
@@ -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;