I'm wondering how to close or destruct a PeerConnectionInterface object? It crashed when I'm trying to do so.
The crash step is:
1. PeerConnectionInterface->Close() or ~PeerConnectionInterface() is called.
2. The webrtc_session_desc_factory_.reset() is called.
3. The FailPendingRequests(const std::string& reason) which is in ~WebRtcSessionDescriptionFactory() is called.
4. Crashed in the while loop.
I have an object declared like this:
rtc::scoped_refptr<webrtc::PeerConnectionInterface> _peerConnection;
It works fine after I create the PeerConnectionInterface by factory.
However, when the session is over and I try to call _peerConnection->Close(); The program crashed. And I also try to call _peerConnection.release()->Release(); Crashed as well.
I print logs in PeerConnection.cc which is from the source code of WebRtc, and find that it crashed here, which is in Close() function and ~PeerConnection() function:
webrtc_session_desc_factory_.reset(); //PeerConnection.cc
The declare is:
std::unique_ptr<WebRtcSessionDescriptionFactory> webrtc_session_desc_factory_;
So I continue to log in WebRtcSessionDescriptionFactory.cc, the
~WebRtcSessionDescriptionFactory() function. Crashed in this
function:FailPendingRequests(). Entered the FailPendingRequests() function:
FailPendingRequests(const std::string& reason)
{
RTC_DCHECK(signaling_thread_->IsCurrent());
while (!create_session_description_requests_.empty())
{
const CreateSessionDescriptionRequest& request =
create_session_description_requests_.front();
//Crashed here in third or fourth loop
PostCreateSessionDescriptionFailed(request.observer,
((request.type == CreateSessionDescriptionRequest::kOffer) ?
"CreateOffer" : "CreateAnswer") + reason);
create_session_description_requests_.pop();
}
}
I will be really grateful for any suggestion!
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/0a2a7a19-faee-4c4e-94e0-7be136be4175%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
webrtc_session_desc_factory_, instead of calling reset, which means I haven't released the memory. The following steps continue smoothly, and it seems destruct the peerconnectionInterface successfully (Obviously not). And when I'm trying to create a new peerconnectionInterface from factory after the destruction, crashed as I expected. Maybe is that any way to check if signaling_thread_ is still working or to track the posted signal? PostCreateSessionDescriptionFailed(request.observer,
((request.type == CreateSessionDescriptionRequest::kOffer) ? "CreateOffer" : "CreateAnswer") + reason);To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/ac104f2d-1c82-4b33-a2c7-854ba04007e5%40googlegroups.com.