mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +00:00
plug qt_initLocale() memory leak
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
cdabe77b9c
commit
76e9cb8220
1 changed files with 7 additions and 1 deletions
|
@ -279,12 +279,18 @@ double qstrtod(const char *s00, const char **se, bool *ok)
|
|||
*/
|
||||
static UCollator *icuCollator = Q_NULLPTR;
|
||||
|
||||
bool qt_initLocale(const QString &locale)
|
||||
static void qt_deinitLocale()
|
||||
{
|
||||
if (icuCollator) {
|
||||
ucol_close(icuCollator);
|
||||
icuCollator = Q_NULLPTR;
|
||||
}
|
||||
}
|
||||
Q_DESTRUCTOR_FUNCTION(qt_deinitLocale);
|
||||
|
||||
bool qt_initLocale(const QString &locale)
|
||||
{
|
||||
qt_deinitLocale();
|
||||
|
||||
UErrorCode error = U_ZERO_ERROR;
|
||||
icuCollator = ucol_open(locale.toLatin1().constData(), &error);
|
||||
|
|
Loading…
Add table
Reference in a new issue