diff --git a/src/generic/animateg.cpp b/src/generic/animateg.cpp index dbdc6665d1..f69ba2dd86 100644 --- a/src/generic/animateg.cpp +++ b/src/generic/animateg.cpp @@ -583,7 +583,8 @@ void wxAnimationCtrl::DisposeToBackground() // clear the backing store wxMemoryDC dc; dc.SelectObject(m_backingStore); - DisposeToBackground(dc); + if ( dc.IsOk() ) + DisposeToBackground(dc); } void wxAnimationCtrl::DisposeToBackground(wxDC& dc)