Skip to content
Snippets Groups Projects
Commit 08dc49d1 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

SipCall: capture weak_ptr instead of this to avoid use-after-free

Change-Id: I92a9a61c8d34736af99693ec826dd2385c319bfa
parent 33fe6bb3
No related branches found
No related tags found
No related merge requests found
...@@ -1241,7 +1241,10 @@ SIPCall::startAllMedia() ...@@ -1241,7 +1241,10 @@ SIPCall::startAllMedia()
rtp->updateMedia(remote, local); rtp->updateMedia(remote, local);
rtp->setSuccessfulSetupCb( rtp->setSuccessfulSetupCb(
[this](MediaType type, bool isRemote) { rtpSetupSuccess(type, isRemote); }); [wthis = weak()](MediaType type, bool isRemote) {
if (auto this_ = wthis.lock())
this_->rtpSetupSuccess(type, isRemote);
});
#ifdef ENABLE_VIDEO #ifdef ENABLE_VIDEO
videortp_->setRequestKeyFrameCallback([wthis = weak()] { videortp_->setRequestKeyFrameCallback([wthis = weak()] {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment