From 31bed730a8433d13bafc15074a1fc85b706e6b76 Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 4 Mar 2015 05:56:13 +1100 Subject: [PATCH] fix memory leak in settings class --- Source/Project64/Settings/Settings Class.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index e4b2d0dc3..e291a3cf9 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -67,6 +67,7 @@ void CSettings::AddHandler ( SettingID TypeID, CSettingType * Handler ) SETTING_MAP::_Pairib res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID,Handler)); if (!res.second) { + delete res.first->second; m_SettingInfo.erase(res.first); res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID,Handler)); if (!res.second)