I found memory leak with QTextCodec::codecForName on Qt4.6. How can I get rid of it?
I found memory leak with QTextCodec::codecForName on Qt4.6, WindowsXP, VS2008.
For testing, I wrote a simple application.
Code:
int main(int argc, char *argv[])
{
QObject::connect(&hello,
SIGNAL(clicked
()),
&app,
SLOT(quit
()));
hello.show();
return app.exec();
}
This code make some memory leak.
If I commented out line4, there is no memory leak. (However, my application needs the codec. )
//QTextCodec::setCodecForCStrings(QTextCodec::codecF orName("EUC-KR"));
In the official Qt documents, they mention that QApplication will de-allocate the QTextCodec's memory.
But, in my opinion, It doesn't work.
How can I get rid of this leak? or Is there something that I missed?