From c54f772618a355d94fa5cb110659cfddd1d4e685 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 28 May 2024 08:32:11 +0200 Subject: [PATCH] QHttpMultiPartPrivate: de-inline dtors of polymorphic classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevents weak (= duplicated) vtables and the associated problems. Amends the start of the public history. Pick-to: 6.7 6.5 Task-number: QTBUG-45582 Change-Id: I26618483900437aca05c753a5d53a359e43bd702 Reviewed-by: MÃ¥rten Nordheim (cherry picked from commit 645509935ad5a2e8a3fcc858c41d08919a2596bd) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/qhttpmultipart.cpp | 8 ++++++++ src/network/access/qhttpmultipart_p.h | 9 ++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/network/access/qhttpmultipart.cpp b/src/network/access/qhttpmultipart.cpp index a695969f008..711d89544c7 100644 --- a/src/network/access/qhttpmultipart.cpp +++ b/src/network/access/qhttpmultipart.cpp @@ -409,6 +409,14 @@ QHttpMultiPartPrivate::QHttpMultiPartPrivate() : contentType(QHttpMultiPart::Mix Q_ASSERT(boundary.size() <= 70); } +QHttpMultiPartPrivate::~QHttpMultiPartPrivate() +{ + delete device; +} + +QHttpMultiPartIODevice::~QHttpMultiPartIODevice() + = default; + qint64 QHttpMultiPartIODevice::size() const { // if not done yet, we calculate the size and the offsets of each part, diff --git a/src/network/access/qhttpmultipart_p.h b/src/network/access/qhttpmultipart_p.h index c8cc3f4f5aa..12462849b6c 100644 --- a/src/network/access/qhttpmultipart_p.h +++ b/src/network/access/qhttpmultipart_p.h @@ -94,8 +94,7 @@ public: QIODevice(), multiPart(parentMultiPart), readPointer(0), deviceSize(-1) { } - ~QHttpMultiPartIODevice() { - } + ~QHttpMultiPartIODevice() override; virtual bool atEnd() const override { return readPointer == size(); @@ -135,11 +134,7 @@ class QHttpMultiPartPrivate: public QObjectPrivate public: QHttpMultiPartPrivate(); - - ~QHttpMultiPartPrivate() - { - delete device; - } + ~QHttpMultiPartPrivate() override; QList parts; QByteArray boundary;