diff --git a/LEGO1/lego/legoomni/include/legonamedpart.h b/LEGO1/lego/legoomni/include/legonamedpart.h index dcdee2f9f0..a03da68c0f 100644 --- a/LEGO1/lego/legoomni/include/legonamedpart.h +++ b/LEGO1/lego/legoomni/include/legonamedpart.h @@ -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; }