Fix invalid read when a CallSession tries to notify a Call that has been destroyed.

This commit is contained in:
Ghislain MARY 2018-01-08 11:38:45 +01:00
parent bbd6c58dfd
commit 68ca9907c1
5 changed files with 20 additions and 0 deletions

View file

@ -19,6 +19,7 @@
#include "conference/local-conference-p.h"
#include "conference/participant-p.h"
#include "conference/session/media-session-p.h"
#include "local-conference-call-p.h"
// =============================================================================
@ -50,6 +51,13 @@ LocalConferenceCall::LocalConferenceCall (
participant->getPrivate()->getSession()->configure(direction, cfg, op, from, to);
}
LocalConferenceCall::~LocalConferenceCall () {
L_D();
auto session = d->getActiveSession();
if (session)
session->getPrivate()->setCallSessionListener(nullptr);
}
shared_ptr<Core> LocalConferenceCall::getCore () const {
return Call::getCore();
}

View file

@ -47,6 +47,7 @@ public:
SalCallOp *op,
const MediaSessionParams *msp
);
virtual ~LocalConferenceCall ();
std::shared_ptr<Core> getCore () const;

View file

@ -19,6 +19,7 @@
#include "conference/remote-conference-p.h"
#include "conference/participant-p.h"
#include "conference/session/media-session-p.h"
#include "remote-conference-call-p.h"
// =============================================================================
@ -50,6 +51,13 @@ RemoteConferenceCall::RemoteConferenceCall (
participant->getPrivate()->getSession()->configure(direction, cfg, op, from, to);
}
RemoteConferenceCall::~RemoteConferenceCall () {
L_D();
auto session = d->getActiveSession();
if (session)
session->getPrivate()->setCallSessionListener(nullptr);
}
shared_ptr<Core> RemoteConferenceCall::getCore () const {
return Call::getCore();
}

View file

@ -42,6 +42,7 @@ public:
SalCallOp *op,
const MediaSessionParams *msp
);
virtual ~RemoteConferenceCall ();
std::shared_ptr<Core> getCore () const;

View file

@ -43,6 +43,8 @@ class LINPHONE_PUBLIC CallSession : public Object, public CoreAccessor {
friend class ClientGroupChatRoomPrivate;
friend class Conference;
friend class CorePrivate;
friend class LocalConferenceCall;
friend class RemoteConferenceCall;
friend class ServerGroupChatRoom;
friend class ServerGroupChatRoomPrivate;