[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: kdelibs/khtml
From: Waldo Bastian <bastian () kde ! org>
Date: 2000-06-29 17:07:59
[Download RAW message or body]
On Thu, 29 Jun 2000, Stephan Kulow wrote:
> I don't see how it causes leaks. A QString for "http" is only constructed
> once this way and never lost as we have a global reference to it.
Yup.. sounds good. We can put then in a QDict :-)
const QString *KConstString::string(const char *str)
{
QAsciiDict<QString> *globalDict = 0;
if (!globalDict)
globalDict = new QAsciiDict<QString>;
QString *result = globalDict->find(str);
if (!result)
{
result = new QString(QString::fromLatin1(str));
globalDict->insert(str, result);
}
return result;
}
Cheers,
Waldo
--
Make way, KDE/Linux is coming to a desktop near you!
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic