X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7ba4fbebbc40bdf9c140f4c9ba9977fbf810527d..921f5019a6e6fd0c5983b7ebe7e02c53a9776998:/src/msw/dcmemory.cpp?ds=sidebyside diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index 744f2ae65a..ea4c0c90e6 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -5,7 +5,7 @@ // Modified by: // Created: 01/02/97 // RCS-ID: $Id$ -// Copyright: (c) Julian Smart and Markus Holzem +// Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -104,22 +104,26 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap) ::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap); if ( m_selectedBitmap.Ok() ) { +#ifdef __WXDEBUG__ m_selectedBitmap.SetSelectedInto(NULL); +#endif m_selectedBitmap = wxNullBitmap; } } // check for whether the bitmap is already selected into a device context - wxCHECK_RET( !bitmap.GetSelectedInto() || - (bitmap.GetSelectedInto() == this), - wxT("Bitmap is selected in another wxMemoryDC, delete the first wxMemoryDC or use SelectObject(NULL)") ); + wxASSERT_MSG( !bitmap.GetSelectedInto() || + (bitmap.GetSelectedInto() == this), + wxT("Bitmap is selected in another wxMemoryDC, delete the first wxMemoryDC or use SelectObject(NULL)") ); m_selectedBitmap = bitmap; WXHBITMAP hBmp = m_selectedBitmap.GetHBITMAP(); if ( !hBmp ) return; +#ifdef __WXDEBUG__ m_selectedBitmap.SetSelectedInto(this); +#endif hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp); if ( !hBmp )