X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5a332fb5e08328833f78c4ca999d5d102239a309..4b7ded8bad3a45ea4838e6d3f5d1957a134050ec:/contrib/src/animate/animate.cpp?ds=inline diff --git a/contrib/src/animate/animate.cpp b/contrib/src/animate/animate.cpp index a0fd35de33..2bca70edb8 100644 --- a/contrib/src/animate/animate.cpp +++ b/contrib/src/animate/animate.cpp @@ -292,13 +292,13 @@ bool wxAnimationPlayer::PlayFrame() // Clear the wxImage cache void wxAnimationPlayer::ClearCache() { - wxNode* node = m_frames.GetFirst(); + wxList::compatibility_iterator node = m_frames.GetFirst(); while (node) { - wxNode* next = node->GetNext(); + wxList::compatibility_iterator next = node->GetNext(); wxBitmap* bitmap = (wxBitmap*) node->GetData(); delete bitmap; - delete node; + m_frames.Erase(node); node = next; } } @@ -369,7 +369,7 @@ void wxAnimationPlayer::DrawFrame(int frame, wxDC& dc, const wxPoint& pos) { wxASSERT_MSG( (m_animation != NULL), _T("Animation not present in wxAnimationPlayer")); wxASSERT_MSG( (m_frames.GetCount() != 0), _T("Animation cache not present in wxAnimationPlayer")); - wxASSERT_MSG( (m_frames.Item(frame) != (wxNode*) NULL), _T("Image not present in wxAnimationPlayer::DrawFrame")); + wxASSERT_MSG( !!m_frames.Item(frame), _T("Image not present in wxAnimationPlayer::DrawFrame")); wxBitmap* bitmap = (wxBitmap*) m_frames.Item(frame)->GetData() ;