Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 181715 Details for
Bug 258660
[PATCH] kde-base/kdelibs-4.2.0-r2: memory leak in KCatalog
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix by upstream
kcatalog.patch (text/plain), 1.57 KB, created by
Andrey Batyiev
on 2009-02-11 23:29:18 UTC
(
hide
)
Description:
fix by upstream
Filename:
MIME Type:
Creator:
Andrey Batyiev
Created:
2009-02-11 23:29:18 UTC
Size:
1.57 KB
patch
obsolete
>--- trunk/KDE/kdelibs/kdecore/localization/kcatalog.cpp 2009/01/29 23:52:33 918504 >+++ trunk/KDE/kdelibs/kdecore/localization/kcatalog.cpp 2009/01/29 23:58:27 918505 >@@ -37,6 +37,10 @@ > # endif > #endif > >+static char *langenv = 0; >+static const int langenvMaxlen = 42; >+// = "LANGUAGE=" + 32 chars for language code + terminating zero >+ > class KCatalogPrivate > { > public: >@@ -82,6 +86,15 @@ > > // Invalidate current language, to trigger binding at next translate call. > KCatalogPrivate::currentLanguage.clear(); >+ >+ if (!langenv) { >+ // Call putenv only here, to initialize LANGUAGE variable. >+ // Later only change langenv to what is currently needed. >+ langenv = new char[langenvMaxlen]; >+ QByteArray lang = qgetenv("LANGUAGE"); >+ snprintf(langenv, langenvMaxlen, "LANGUAGE=%s", lang.constData()); >+ putenv(langenv); >+ } > } > > KCatalog::KCatalog(const KCatalog & rhs) >@@ -136,7 +149,9 @@ > // Point Gettext to current language, recording system value for recovery. > systemLanguage = qgetenv("LANGUAGE"); > if (systemLanguage != language) { >- qputenv("LANGUAGE", language); >+ // putenv has been called in the constructor, >+ // it is enough to change the string set there. >+ snprintf(langenv, langenvMaxlen, "LANGUAGE=%s", language.constData()); > } > > // Rebind text domain if language actually changed from the last time, >@@ -160,7 +175,7 @@ > void KCatalogPrivate::resetSystemLanguage () > { > if (language != systemLanguage) { >- qputenv("LANGUAGE", systemLanguage); >+ snprintf(langenv, langenvMaxlen, "LANGUAGE=%s", systemLanguage.constData()); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 258660
: 181715