Commit 33b0282b authored by Tristan Matthews's avatar Tristan Matthews

* #6596: declare certain destructors virtual

parent dab0969f
......@@ -238,7 +238,7 @@ AC_ARG_WITH(debug,
if test "x$with_debug" = "xfull" -o "x$with_debug" = "xyes"; then
CXXFLAGS="$USE_EXCEPTIONS $USER_INCLUDES -g -O0 -Wno-return-type"
else
CXXFLAGS="-g -Wall -O2"
CXXFLAGS="-g -Wall -O2 -Wnon-virtual-dtor"
fi
AC_CHECK_LIB([expat], XML_ParserCreate_MM,
......
......@@ -40,9 +40,7 @@
*/
class Algorithm
{
public:
virtual void reset (void) = 0;
/**
......@@ -76,6 +74,7 @@ class Algorithm
*/
virtual void process (SFLDataFormat *micData, SFLDataFormat *spkrData, SFLDataFormat *outputData, int nbBytes) = 0;
virtual ~Algorithm() {};
};
#endif
......@@ -123,7 +123,7 @@ class AudioRtpRecordHandler
{
public:
AudioRtpRecordHandler (SIPCall *ca);
~AudioRtpRecordHandler();
virtual ~AudioRtpRecordHandler();
/**
* Set rtp media for this session
......
......@@ -306,7 +306,9 @@ int AudioRtpSession::startRtpThread (AudioCodec* audiocodec)
if (_type == Zrtp)
return ret;
return static_cast<AudioSymmetricRtpSession*>(this)->startSymmetricRtpThread();
AudioSymmetricRtpSession *self = dynamic_cast<AudioSymmetricRtpSession*>(this);
assert(self);
return self->startSymmetricRtpThread();
}
void AudioRtpSession::stopRtpThread ()
......
......@@ -59,7 +59,6 @@ AudioSymmetricRtpSession::~AudioSymmetricRtpSession()
void AudioSymmetricRtpSession::final()
{
delete _rtpThread;
delete this;
......
......@@ -40,7 +40,7 @@ class Recordable
Recordable();
~Recordable();
virtual ~Recordable();
/**
* Return recording state (true/false)
......
......@@ -45,6 +45,7 @@ class Engine
virtual void write() = 0;
virtual void read() = 0;
virtual ~Engine();
};
......
......@@ -43,13 +43,10 @@ class Serializable
{
public:
virtual ~Serializable() {};
virtual void serialize (Conf::YamlEmitter *emitter) = 0;
virtual void unserialize (Conf::MappingNode *map) = 0;
private:
};
#endif
......@@ -54,7 +54,7 @@ class YamlNode
YamlNode (NodeType t, YamlNode *top=NULL) : type (t), topNode (top) {}
~YamlNode (void) {}
virtual ~YamlNode (void) {}
NodeType getType (void) {
return type;
......
......@@ -62,20 +62,11 @@ SIPCall::~SIPCall()
{
_debug ("SIPCall: Delete call");
delete _audiortp;
_audiortp = NULL;
delete _local_sdp;
_local_sdp = NULL;
_debug ("SDP: pool capacity %d", pj_pool_get_capacity (_pool));
_debug ("SDP: pool size %d", pj_pool_get_used_size (_pool));
// Release memory allocated for SDP
pj_pool_release (_pool);
_pool = NULL;
delete _audiortp;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment