summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
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
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')
-rw-r--r--src/corelib/io/qdebug.cpp14
-rw-r--r--src/corelib/io/qdebug.h13
2 files changed, 15 insertions, 12 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)
diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h
index a1294d0b40..94b19f9cab 100644
--- a/src/corelib/io/qdebug.h
+++ b/src/corelib/io/qdebug.h
@@ -78,18 +78,7 @@ public:
inline QDebug(QtMsgType t) : stream(new Stream(t)) {}
inline QDebug(const QDebug &o):stream(o.stream) { ++stream->ref; }
inline QDebug &operator=(const QDebug &other);
- inline ~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;
- }
- }
+ ~QDebug();
inline void swap(QDebug &other) { qSwap(stream, other.stream); }
inline QDebug &space() { stream->space = true; stream->ts << ' '; return *this; }