Skip to content

Commit

Permalink
fixed - mem leaks in CPeripherals. map entries are not automatically …
Browse files Browse the repository at this point in the history
…deleted when a map is cleared
  • Loading branch information
opdenkamp authored and elupus committed Jan 8, 2012
1 parent 6ee09da commit b9a63ad
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions xbmc/peripherals/Peripherals.cpp
Expand Up @@ -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 */
Expand Down

0 comments on commit b9a63ad

Please sign in to comment.