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
This commit is contained in:
Kevin Ollivier 2006-11-22 19:54:38 +00:00
parent dee1a629b6
commit 90b0f5fced

View 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;