From dca63b6ef68c6bdaecad38db71295c5a0507914f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 16 Nov 2021 08:36:21 +0100 Subject: [PATCH] QIODeviceBase: make dtor protected Base class dtors should be virtual and public or else protected and non-virtual. This one was neither of these. [ChangeLog][Potentially Source-Incompatible Changes][QtCore] The QIODeviceBase destructor is now protected to avoid deleting objects of classes derived from it through a QIODeviceBase pointer, which would be undefined behavior. Change-Id: Id390ace75d5b64f746d9b1865b8800c9f0590977 Reviewed-by: Thiago Macieira --- src/corelib/io/qiodevicebase.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/io/qiodevicebase.h b/src/corelib/io/qiodevicebase.h index f1032a1dde5..3c6ca89f7ae 100644 --- a/src/corelib/io/qiodevicebase.h +++ b/src/corelib/io/qiodevicebase.h @@ -46,6 +46,8 @@ QT_BEGIN_NAMESPACE class QIODeviceBase { +protected: + ~QIODeviceBase() = default; public: enum OpenModeFlag { NotOpen = 0x0000,