Permalink
Browse files

fixed - mem leaks in CPeripherals. map entries are not automatically …

…deleted when a map is cleared
  • Loading branch information...
1 parent 6ee09da commit b9a63ad3b456167153613bc3b298afcf85c0d9c2 Lars Op den Kamp committed with Dec 31, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 xbmc/peripherals/Peripherals.cpp
@@ -105,7 +105,12 @@ void CPeripherals::Clear(void)
/* delete mappings */
for (unsigned int iMappingPtr = 0; iMappingPtr < m_mappings.size(); iMappingPtr++)
+ {
+ map<CStdString, CSetting *> settings = m_mappings.at(iMappingPtr).m_settings;
+ for (map<CStdString, CSetting *>::iterator itr = settings.begin(); itr != settings.end(); itr++)
+ delete itr->second;
m_mappings.at(iMappingPtr).m_settings.clear();
+ }
m_mappings.clear();
/* reset class state */

0 comments on commit b9a63ad

Please sign in to comment.