X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/223d09f6b523aac674ef9b72a883dfa8d37c5d4e..2a31049201e9c1ff9f515eb9d144ae392f4b4e5a:/src/msw/dcclient.cpp diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp index ec20193357..ca1caadb27 100644 --- a/src/msw/dcclient.cpp +++ b/src/msw/dcclient.cpp @@ -62,11 +62,9 @@ WX_DEFINE_OBJARRAY(wxArrayDCInfo); // macros // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC) IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC) -#endif // ---------------------------------------------------------------------------- // global variables @@ -234,6 +232,11 @@ wxPaintDC::~wxPaintDC() ::EndPaint(GetWinHwnd(m_canvas), &g_paintStruct); ms_cache.Remove(index); + + // Reduce the number of bogus reports of non-freed memory + // at app exit + if (ms_cache.IsEmpty()) + ms_cache.Clear(); } //else: cached DC entry is still in use