[Nepomuk] Review Request 114390: nepomukctl: Do not create a global static QTextStream.

Raphael Kubo da Costa rakuco at FreeBSD.org
Tue Dec 10 17:37:09 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/114390/
-----------------------------------------------------------

Review request for Nepomuk, Gabriel Poesia and Vishesh Handa.


Repository: nepomuk-core


Description
-------

nepomukctl: Do not create a global static QTextStream.

Creating global static objects is a big no-no, and is properly documented in
KDE's policies. One never knows the order in which they are created and
destroyed, which was causing crashes at least on FreeBSD when libcxxrt is
used, as Qt's Q_GLOBAL_STATIC cleanup code would destroy QTextCodec
instances still referenced by that global QTextStream.

Since the QTextStream was only used as glorified fprintf(), resort to just
printing to std::cerr directly.


Diffs
-----

  tools/nepomukctl/main.cpp 93d8a78779efb2d64ef5de6072d8d19ff09dd5fe 

Diff: http://git.reviewboard.kde.org/r/114390/diff/


Testing
-------

`nepomukctl status' and other commands finally work instead of crashing.


Thanks,

Raphael Kubo da Costa

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/nepomuk/attachments/20131210/0406d4c7/attachment.html>


More information about the Nepomuk mailing list