X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/196fc5f2883badc4c5bcf33a52185e6d7531d853..b85b06e13d22e7fc1604ec1a49caa1227a1b3d36:/src/msw/dcmemory.cpp diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index 1ad90bbb83..d399b5157b 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -80,9 +80,9 @@ void wxMemoryDCImpl::Init() bool wxMemoryDCImpl::CreateCompatible(wxDC *dc) { - wxDCImpl *impl = dc->GetImpl(); + wxDCImpl *impl = dc ? dc->GetImpl() : NULL ; wxMSWDCImpl *msw_impl = wxDynamicCast( impl, wxMSWDCImpl ); - if (!msw_impl) + if ( dc && !msw_impl) { m_ok = false; return false; @@ -106,9 +106,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) ::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap); if ( m_selectedBitmap.Ok() ) { -#ifdef __WXDEBUG__ m_selectedBitmap.SetSelectedInto(NULL); -#endif m_selectedBitmap = wxNullBitmap; } } @@ -123,9 +121,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) if ( !hBmp ) return; -#ifdef __WXDEBUG__ m_selectedBitmap.SetSelectedInto(GetOwner()); -#endif hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp); if ( !hBmp )