From: Vadim Zeitlin Date: Sat, 9 Mar 2013 15:08:09 +0000 (+0000) Subject: Don't cache HDC used by wxPaintDCEx in wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/025f5d1450a029e059807b1b0aba0233856f3891 Don't cache HDC used by wxPaintDCEx in wxMSW. This avoids the problem with mistakenly using wrong HDC in wxBitmapComboBox code which was due to assuming that we can only ever have one paint HDC for the given window -- while in wxBitmapComboBox case we are passed different HDCs for the same window via WM_DRAWITEM. Instead of fixing the cache, just don't use it at all for wxPaintDCEx as we don't gain anything from doing it anyhow. Closes #14842. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp index 112cf781f5..1da0e01531 100644 --- a/src/msw/dcclient.cpp +++ b/src/msw/dcclient.cpp @@ -377,15 +377,7 @@ wxPaintDCExImpl::wxPaintDCExImpl(wxDC *owner, wxWindow *window, WXHDC dc) wxCHECK_RET( dc, wxT("wxPaintDCEx requires an existing device context") ); m_window = window; - - m_hDC = FindDCInCache(m_window); - if ( !m_hDC ) - { - // not in cache, record it there - gs_PaintDCInfos[m_window] = new wxPaintDCInfoExternal(dc); - - m_hDC = dc; - } + m_hDC = dc; } wxPaintDCExImpl::~wxPaintDCExImpl()