summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qiodevicebase.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2021-11-16 08:36:21 +0100
committerMarc Mutz <marc.mutz@qt.io>2021-11-18 17:13:19 +0000
commitdca63b6ef68c6bdaecad38db71295c5a0507914f (patch)
tree425cf6aabad774fb22742eba11edf6f17b8b3312 /src/corelib/io/qiodevicebase.h
parent0e245c158f59f5517201d139b31a7a1b98ed09c6 (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qiodevicebase.h')
-rw-r--r--src/corelib/io/qiodevicebase.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qiodevicebase.h b/src/corelib/io/qiodevicebase.h
index f1032a1dde..3c6ca89f7a 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,