Match MxPtrList<LegoNamedPart>::Destroy (#1285)

This commit is contained in:
Christian Semmler 2024-12-26 12:57:30 -07:00 committed by GitHub
parent 2d302ddf9b
commit fd5f7ad620
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -12,7 +12,18 @@ class LegoNamedPart {
m_name = p_name;
m_list = p_list;
}
~LegoNamedPart() { delete m_list; }
~LegoNamedPart()
{
LegoLODListCursor cursor(m_list);
LegoLOD* lod;
while (cursor.First(lod)) {
cursor.Detach();
delete lod;
}
delete m_list;
}
const MxString* GetName() const { return &m_name; }
LegoLODList* GetList() { return m_list; }