X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/888dde65f43d5f57e8fb2028b27191cca1741403..0bbe61b8c18a1795189f0cf73cc61c14a0fb846d:/src/msw/dcmemory.cpp diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index 37605f4750..6869e6f4e4 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; @@ -115,7 +115,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) // check for whether the bitmap is already selected into a device context wxASSERT_MSG( !bitmap.GetSelectedInto() || - (bitmap.GetSelectedInto() == this), + (bitmap.GetSelectedInto() == GetOwner()), wxT("Bitmap is selected in another wxMemoryDC, delete the first wxMemoryDC or use SelectObject(NULL)") ); m_selectedBitmap = bitmap; @@ -124,7 +124,7 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap ) return; #ifdef __WXDEBUG__ - m_selectedBitmap.SetSelectedInto(this); + m_selectedBitmap.SetSelectedInto(GetOwner()); #endif hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);