X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2ba06d5a8ccf8c224fcfbd52fa01a55abf7befbd..a6f4dbbd86b54c720bdeab1aea1fad5eb3f030e6:/contrib/src/ogl/mfutils.cpp diff --git a/contrib/src/ogl/mfutils.cpp b/contrib/src/ogl/mfutils.cpp index 6c268e8425..229895912b 100644 --- a/contrib/src/ogl/mfutils.cpp +++ b/contrib/src/ogl/mfutils.cpp @@ -728,13 +728,13 @@ bool wxXMetaFile::ReadFile(const wxChar *file) wxXMetaFile::~wxXMetaFile(void) { - wxNode *node = metaRecords.GetFirst(); + wxObjectList::compatibility_iterator node = metaRecords.GetFirst(); while (node) { wxMetaRecord *rec = (wxMetaRecord *)node->GetData(); delete rec; - wxNode *next = node->GetNext(); - delete node; + wxObjectList::compatibility_iterator next = node->GetNext(); + metaRecords.Erase(node); node = next; } } @@ -746,7 +746,7 @@ bool wxXMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height)) bool wxXMetaFile::Play(wxDC *dc) { - wxNode *node = metaRecords.GetFirst(); + wxObjectList::compatibility_iterator node = metaRecords.GetFirst(); while (node) { wxMetaRecord *rec = (wxMetaRecord *)node->GetData();