Make a copy of the translated text

Otherwise the translation will get freed (and often reused) before it
makes it to the screen.
The problem with this is that it leaks memory for every translation.

Reported-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2013-10-08 13:22:32 -07:00
parent 292b9aed48
commit c260ec5c16

View file

@ -4,7 +4,7 @@
char *gettextFromC::gettext(const char *text)
{
return tr(text).toLocal8Bit().data();
return strdup(tr(text).toLocal8Bit().data());
}
gettextFromC* gettextFromC::instance()