Virtual destructor for QAMQP::Frame::Base

To solve the GCC warning:
deleting object of polymorphic class type ‘QAMQP::Frame::Method’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
This commit is contained in:
Michel D'HOOGE 2013-02-19 11:29:00 +01:00
parent e2c77e13d8
commit 4d02fe7383
2 changed files with 9 additions and 1 deletions

View File

@ -19,6 +19,9 @@ Type Base::type() const
return Type(type_);
}
Base::~Base()
{}
void Base::setChannel( qint16 channel )
{
channel_ = channel;
@ -343,7 +346,7 @@ void QAMQP::Frame::writeField( qint8 valueType, QDataStream &s, const QVariant &
{
QByteArray tmp;
if(withType)
s << valueType; // Запишем тип поля
s << valueType;
switch(valueType)
{

View File

@ -109,6 +109,11 @@ namespace QAMQP
*/
Base(QDataStream& raw);
/*!
Base class virtual destructor
*/
virtual ~Base();
/*!
Frame type
@detailed Return type of current frame.