From 58efee483561b22aed5b6b62226c1bc94d886113 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Thu, 3 May 2012 17:27:45 +0400 Subject: [PATCH] system/localize.cpp: fix destructor --- src/system/localize.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/system/localize.cpp b/src/system/localize.cpp index dc924a4f6..bed4a433a 100644 --- a/src/system/localize.cpp +++ b/src/system/localize.cpp @@ -99,10 +99,16 @@ CLocaleManager::CLocaleManager() CLocaleManager::~CLocaleManager() { for (unsigned j = 0; j < (sizeof(locale_real_names)/sizeof(const char *)); j++) - if (localeData[j] != locale_real_names[j]) + if (localeData[j] != locale_real_names[j] && localeData[j] != defaultData[j]) ::free(localeData[j]); - delete localeData; + delete[] localeData; + + for (unsigned j = 0; j < (sizeof(locale_real_names)/sizeof(const char *)); j++) + if (defaultData[j] != locale_real_names[j]) + ::free(defaultData[j]); + + delete[] defaultData; } const char * path[2] = {"/var/tuxbox/config/locale/", DATADIR "/neutrino/locale/"};