Add virtual destructors to two classes with other virtuals
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 25 Jan 2013 21:39:28 +0000 (13:39 -0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 25 Jan 2013 21:48:56 +0000 (22:48 +0100)
Classes with virtuals are used polymorphically (why have virtuals
otherwise?), so they need virtual destructors to be deleted
properly. Unless they are never deleted using objects of those two
classes -- but why have the interface in the first place if that's the
case?

This is binary incompatible change. It was agreed upon in the mailing
list.

Change-Id: I697e4bd53251452a0e6b0c09edd08c4835f90cbd
Discussed-on: http://lists.qt-project.org/pipermail/development/2012-December/008908.html
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/multimedia/audio/qaudiosystemplugin.cpp
src/multimedia/audio/qaudiosystemplugin.h
src/multimedia/qmediaserviceprovider.cpp
src/multimedia/qmediaserviceproviderplugin.h

index 85fa855..0262026 100644 (file)
 
 QT_BEGIN_NAMESPACE
 
+QAudioSystemFactoryInterface::~QAudioSystemFactoryInterface()
+{
+}
+
 /*!
     \class QAudioSystemPlugin
     \brief The QAudioSystemPlugin class provides an abstract base for audio plugins.
index 7a8a460..b2e1dd1 100644 (file)
@@ -66,6 +66,7 @@ struct Q_MULTIMEDIA_EXPORT QAudioSystemFactoryInterface
     virtual QAbstractAudioInput* createInput(const QByteArray& device) = 0;
     virtual QAbstractAudioOutput* createOutput(const QByteArray& device) = 0;
     virtual QAbstractAudioDeviceInfo* createDeviceInfo(const QByteArray& device, QAudio::Mode mode) = 0;
+    virtual ~QAudioSystemFactoryInterface();
 };
 
 #define QAudioSystemFactoryInterface_iid \
index 8be091d..09dff9d 100644 (file)
 
 QT_BEGIN_NAMESPACE
 
+QMediaServiceProviderFactoryInterface::~QMediaServiceProviderFactoryInterface()
+{
+}
+
 class QMediaServiceProviderHintPrivate : public QSharedData
 {
 public:
index 870ee59..9a7ff1d 100644 (file)
@@ -112,6 +112,7 @@ struct Q_MULTIMEDIA_EXPORT QMediaServiceProviderFactoryInterface
 {
     virtual QMediaService* create(QString const& key) = 0;
     virtual void release(QMediaService *service) = 0;
+    virtual ~QMediaServiceProviderFactoryInterface();
 };
 
 #define QMediaServiceProviderFactoryInterface_iid \