- m_staticPaintCount -- ;
-
- if (m_staticPaintCount == 0)
- {
-// m_canvas->m_paintHDC = 0;
-
- if ( m_hDC && m_canvas)
- {
- ::EndPaint((HWND) m_canvas->GetHWND(), &g_paintStruct);
- m_hDCCount --;
- m_hDC = 0;
- }
- else
- wxDebugMsg("~wxPaintDC: Did not release HDC\n");
-
- m_staticPaintHDC = 0 ;
- }
- else
- {
- wxDebugMsg("~wxPaintDC: Did not release HDC\n");
+ if ( m_hDC ) {
+ if ( !--ms_PaintCount ) {
+ ::EndPaint((HWND)m_canvas->GetHWND(), &g_paintStruct);
+ m_hDCCount--;
+ m_hDC = NULL;
+ ms_PaintHDC = NULL;