int main () {
QTextStream out(stdout);
out.setCodec(QTextCodec::codecForName("UTF-8"));
QDateTime h = QDateTime::currentDateTime();
out << h.toString() << "\n";
}
Вроде бы все прозрачно и утечек быть не должно, однако валгринд утверждает что
........
==5470== by 0x5BCC6E6: ??? (in /usr/lib64/qt4/libQtCore.so.4.8.2)
==5470== by 0x5B9176E: QLocalePrivate::updateSystemPrivate() (in /usr/lib64/qt4/libQtCore.so.4.8.2)
==5470== by 0x5B9199A: ??? (in /usr/lib64/qt4/libQtCore.so.4.8.2)
==5470== by 0x5B92C94: QLocale::system() (in /usr/lib64/qt4/libQtCore.so.4.8.2)
==5470== by 0x5B7BF61: QDate::shortDayName(int) (in /usr/lib64/qt4/libQtCore.so.4.8.2)
==5470== by 0x5B7F49A: QDateTime::toString(Qt::DateFormat) const (in /usr/lib64/qt4/libQtCore.so.4.8.2)
==5470== by 0x4040E3: main (Main.cpp:47)
==5470== LEAK SUMMARY:
==5470== definitely lost: 192 bytes in 2 blocks
==5470== indirectly lost: 284 bytes in 6 blocks
==5470== possibly lost: 0 bytes in 0 blocks
==5470== still reachable: 61,290 bytes in 61 blocks
==5470== suppressed: 0 bytes in 0 blocks
==5470== Reachable blocks (those to which a pointer was found) are not shown.
==5470== To see them, rerun with: --leak-check=full --show-reachable=yes
out << h.toString() << "\n";