summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qdebug.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2014-04-29 12:39:31 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-22 08:35:06 +0200
commit297be273a34b33cf19af0fb2d2bec6df8d3809b6 (patch)
treef4ae8779a5e1364f5f9d8197b6104198927e35c3 /src/corelib/io/qdebug.cpp
parentf2891be00808c82f5069661d60d8727fe28774b7 (diff)
De-inline QDebug destructor
This injected quite some code on every use of qDebug and friends, while not giving any measurable performance benefits. Change-Id: I7b51f99130f18f1252da01e313f7b97c43a5480d Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qdebug.cpp')
-rw-r--r--src/corelib/io/qdebug.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp
index 79038e9138..44d0a788ff 100644
--- a/src/corelib/io/qdebug.cpp
+++ b/src/corelib/io/qdebug.cpp
@@ -128,6 +128,20 @@ QT_BEGIN_NAMESPACE
Flushes any pending data to be written and destroys the debug stream.
*/
+// Has been defined in the header / inlined before Qt 5.4
+QDebug::~QDebug()
+{
+ if (!--stream->ref) {
+ if (stream->space && stream->buffer.endsWith(QLatin1Char(' ')))
+ stream->buffer.chop(1);
+ if (stream->message_output) {
+ qt_message_output(stream->type,
+ stream->context,
+ stream->buffer);
+ }
+ delete stream;
+ }
+}
/*!
\fn QDebug::swap(QDebug &other)