From 1c3087b2e676fa471733584216e2b6b5f4aaf030 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 17 Sep 2024 13:37:35 +0200 Subject: [PATCH] De-inline ~QDeviceClosedNotifier This is weird, since Clang -Wweak-table didn't trigger here. But -Wmarc did... That's because the virtual functions behind the Q_OBJECT macro are implemented in the moc file, so are actually out-of-line. And ~QObject() isn't the first virtual function in QObject... Still define the destructor out-of-line, for consistency. Amends ad265c55beb596e28d6b28c16700795fa8555ee6. Task-number: QTBUG-45582 Task-number: QTBUG-126219 Change-Id: Iada95966b7244873390f4c7ad42de9352311ca33 Reviewed-by: Thiago Macieira (cherry picked from commit 41c5856ffa6cac43c15a6a43261b6693e7b0566f) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/serialization/qtextstream.cpp | 5 +++++ src/corelib/serialization/qtextstream_p.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/corelib/serialization/qtextstream.cpp b/src/corelib/serialization/qtextstream.cpp index e9d650b3e2..78eeb35906 100644 --- a/src/corelib/serialization/qtextstream.cpp +++ b/src/corelib/serialization/qtextstream.cpp @@ -249,6 +249,11 @@ QT_BEGIN_NAMESPACE using namespace Qt::StringLiterals; using namespace QtMiscUtils; +#ifndef QT_NO_QOBJECT +QDeviceClosedNotifier::~QDeviceClosedNotifier() + = default; +#endif + //------------------------------------------------------------------- /*! diff --git a/src/corelib/serialization/qtextstream_p.h b/src/corelib/serialization/qtextstream_p.h index db7bb7ba0d..2f52671077 100644 --- a/src/corelib/serialization/qtextstream_p.h +++ b/src/corelib/serialization/qtextstream_p.h @@ -31,6 +31,7 @@ class QDeviceClosedNotifier : public QObject public: inline QDeviceClosedNotifier() { } + ~QDeviceClosedNotifier() override; inline void setupDevice(QTextStream *stream, QIODevice *device) {