Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit f23a450

Browse files
authored
One of the memory leak fixes
1 parent e18fe7f commit f23a450

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

game/client/panelmetaclassmgr.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
1+
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
22
//
33
// Purpose: A panel "metaclass" is a name given to a particular type of
44
// panel with particular instance data. Such panels tend to be dynamically
@@ -232,8 +232,15 @@ CPanelMetaClassMgrImp::CPanelMetaClassMgrImp() : m_PanelTypeDict( true, 0, 32 )
232232
{
233233
}
234234

235+
// Secton: Memory leak fix (https://developer.valvesoftware.com/wiki/Memory_Leak_Fixes#CPanelMetaClassMgrImp_class)
235236
CPanelMetaClassMgrImp::~CPanelMetaClassMgrImp()
236237
{
238+
while(m_MetaClassKeyValues.Count()>0)
239+
{
240+
if(m_MetaClassKeyValues[0])
241+
m_MetaClassKeyValues[0]->deleteThis();
242+
m_MetaClassKeyValues.RemoveAt(0);
243+
}
237244
}
238245

239246

0 commit comments

Comments
 (0)