Fixed 2 memory leaks so Bruce doesn't have to
git-svn-id: svn://10.0.0.236/trunk@26677 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
8a19907163
commit
d2b766343c
@ -110,6 +110,13 @@ nsLocaleFactory::NewLocale(const nsString* localeName, nsILocale** locale)
|
||||
NS_ASSERTION(newLocale!=NULL,"nsLocaleFactory: failed to create nsLocale");
|
||||
newLocale->AddRef();
|
||||
|
||||
//
|
||||
// delete temporary strings
|
||||
//
|
||||
for(i=0;i<6;i++)
|
||||
delete valueList[i];
|
||||
delete [] valueList;
|
||||
|
||||
*locale = (nsILocale*)newLocale;
|
||||
|
||||
return NS_OK;
|
||||
|
||||
@ -259,6 +259,7 @@ nsIWin32LocaleImpl::GetPlatformLocale(const nsString* locale,LCID* winLCID)
|
||||
if (!ParseLocaleString(locale_string,language_code,country_code,region_code)) {
|
||||
*winLCID = MAKELCID(MAKELANGID(USER_DEFINED_PRIMARYLANG,USER_DEFINED_SUBLANGUAGE),
|
||||
SORT_DEFAULT);
|
||||
delete [] locale_string;
|
||||
return NS_OK;
|
||||
}
|
||||
// we have a LL-CC-RR style string
|
||||
@ -270,6 +271,7 @@ nsIWin32LocaleImpl::GetPlatformLocale(const nsString* locale,LCID* winLCID)
|
||||
//
|
||||
*winLCID = MAKELCID(MAKELANGID(USER_DEFINED_PRIMARYLANG,USER_DEFINED_SUBLANGUAGE),
|
||||
SORT_DEFAULT);
|
||||
delete [] locale_string;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -279,6 +281,7 @@ nsIWin32LocaleImpl::GetPlatformLocale(const nsString* locale,LCID* winLCID)
|
||||
//
|
||||
*winLCID = MAKELCID(MAKELANGID(winLangCode,SUBLANG_DEFAULT),
|
||||
SORT_DEFAULT);
|
||||
delete [] locale_string;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -289,10 +292,12 @@ nsIWin32LocaleImpl::GetPlatformLocale(const nsString* locale,LCID* winLCID)
|
||||
//
|
||||
*winLCID = MAKELCID(MAKELANGID(winLangCode,USER_DEFINED_SUBLANGUAGE),
|
||||
SORT_DEFAULT);
|
||||
delete [] locale_string;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
*winLCID = winLangCode | winSublangCode;
|
||||
delete [] locale_string;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -167,7 +167,7 @@ factory_new_locale(void)
|
||||
delete catagory;
|
||||
delete value;
|
||||
}
|
||||
|
||||
delete localeName;
|
||||
locale->Release();
|
||||
|
||||
catagoryList = new nsString*[6];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user