I found memory leak with QTextCodec::codecForName on Qt4.6, WindowsXP, VS2008.

For testing, I wrote a simple application.

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication app(argc, argv);
  4. QTextCodec::setCodecForCStrings(QTextCodec::codecForName("EUC-KR"));
  5.  
  6. QPushButton hello("한글 테스트");
  7. QObject::connect(&hello, SIGNAL(clicked()), &app, SLOT(quit()));
  8.  
  9. hello.show();
  10.  
  11. return app.exec();
  12. }
To copy to clipboard, switch view to plain text mode 

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?