diff options
Diffstat (limited to 'indra/llwebrtc')
| -rw-r--r-- | indra/llwebrtc/llwebrtc.cpp | 23 | ||||
| -rw-r--r-- | indra/llwebrtc/llwebrtc.h | 3 | 
2 files changed, 14 insertions, 12 deletions
diff --git a/indra/llwebrtc/llwebrtc.cpp b/indra/llwebrtc/llwebrtc.cpp index 97c04ae446..5c71831c65 100644 --- a/indra/llwebrtc/llwebrtc.cpp +++ b/indra/llwebrtc/llwebrtc.cpp @@ -670,24 +670,23 @@ void LLWebRTCPeerConnectionImpl::init(LLWebRTCImpl * webrtc_impl)  }  void LLWebRTCPeerConnectionImpl::terminate()  { -    rtc::scoped_refptr<webrtc::PeerConnectionInterface> connection; -    mPeerConnection.swap(connection); -    rtc::scoped_refptr<webrtc::DataChannelInterface> dataChannel; -    mDataChannel.swap(dataChannel); -    rtc::scoped_refptr<webrtc::MediaStreamInterface> localStream; -    mLocalStream.swap(localStream); -      mWebRTCImpl->PostSignalingTask(          [=]()          { -            if (connection) +            if (mDataChannel)              { -                connection->Close(); +                mDataChannel->UnregisterObserver(); +                mDataChannel->Close(); +                mDataChannel = nullptr;              } -            if (dataChannel) +            if (mPeerConnection) +            { +                mPeerConnection->Close(); +                mPeerConnection = nullptr; +            } +            for (auto &observer : mSignalingObserverList)              { -                dataChannel->UnregisterObserver(); -                dataChannel->Close(); +                observer->OnPeerConnectionClosed();              }          });  } diff --git a/indra/llwebrtc/llwebrtc.h b/indra/llwebrtc/llwebrtc.h index ac71e0c744..ecbab81538 100644 --- a/indra/llwebrtc/llwebrtc.h +++ b/indra/llwebrtc/llwebrtc.h @@ -212,6 +212,9 @@ class LLWebRTCSignalingObserver      // Called when a connection enters a failure state and renegotiation is needed.      virtual void OnRenegotiationNeeded() = 0; +    // Called when a peer connection has shut down +    virtual void OnPeerConnectionClosed() = 0; +      // Called when the audio channel has been established and audio      // can begin.      virtual void OnAudioEstablished(LLWebRTCAudioInterface *audio_interface) = 0;  | 
