mirror of
https://github.com/lubosz/overte.git
synced 2025-08-15 08:53:25 +02:00
Code tidying
This commit is contained in:
parent
e6c49cf407
commit
63ec933290
1 changed files with 13 additions and 2 deletions
|
@ -280,6 +280,11 @@ void WDCConnection::onDataChannelStateChanged() {
|
||||||
<< DataChannelInterface::DataStateString(state);
|
<< DataChannelInterface::DataStateString(state);
|
||||||
#endif
|
#endif
|
||||||
if (state == DataChannelInterface::kClosed) {
|
if (state == DataChannelInterface::kClosed) {
|
||||||
|
_dataChannel->Close();
|
||||||
|
_dataChannel = nullptr;
|
||||||
|
// WEBRTC FIXME: The following line causes the _peerConnectionFactory to fail.
|
||||||
|
//_peerConnection->Close();
|
||||||
|
//_peerConnection = nullptr;
|
||||||
_parent->onDataChannelClosed(this, _dataChannelID);
|
_parent->onDataChannelClosed(this, _dataChannelID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -346,6 +351,9 @@ WebRTCDataChannels::WebRTCDataChannels(NodeType_t nodeType, QObject* parent) :
|
||||||
}
|
}
|
||||||
|
|
||||||
WebRTCDataChannels::~WebRTCDataChannels() {
|
WebRTCDataChannels::~WebRTCDataChannels() {
|
||||||
|
#ifdef WEBRTC_DEBUG
|
||||||
|
qCDebug(networking_webrtc) << "WebRTCDataChannels::~WebRTCDataChannels()";
|
||||||
|
#endif
|
||||||
QHashIterator<quint16, WDCConnection*> i(_connectionsByDataChannel);
|
QHashIterator<quint16, WDCConnection*> i(_connectionsByDataChannel);
|
||||||
while (i.hasNext()) {
|
while (i.hasNext()) {
|
||||||
i.next();
|
i.next();
|
||||||
|
@ -384,7 +392,8 @@ void WebRTCDataChannels::onDataChannelClosed(WDCConnection* connection, quint16
|
||||||
// Delete WDCConnection.
|
// Delete WDCConnection.
|
||||||
_connectionsByWebSocket.remove(connection->getWebSocketID());
|
_connectionsByWebSocket.remove(connection->getWebSocketID());
|
||||||
_connectionsByDataChannel.remove(dataChannelID);
|
_connectionsByDataChannel.remove(dataChannelID);
|
||||||
delete connection;
|
// WEBRTC FIXME: The following line causes the _peerConnectionFactory to fail.
|
||||||
|
//delete connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebRTCDataChannels::onSignalingMessage(const QJsonObject& message) {
|
void WebRTCDataChannels::onSignalingMessage(const QJsonObject& message) {
|
||||||
|
@ -474,7 +483,9 @@ rtc::scoped_refptr<PeerConnectionInterface> WebRTCDataChannels::createPeerConnec
|
||||||
#ifdef WEBRTC_DEBUG
|
#ifdef WEBRTC_DEBUG
|
||||||
qCDebug(networking_webrtc) << "2. Create a new PeerConnection";
|
qCDebug(networking_webrtc) << "2. Create a new PeerConnection";
|
||||||
#endif
|
#endif
|
||||||
return _peerConnectionFactory->CreatePeerConnection(configuration, nullptr, nullptr, peerConnectionObserver.get());
|
PeerConnectionDependencies dependencies(peerConnectionObserver.get());
|
||||||
|
auto result = _peerConnectionFactory->CreatePeerConnection(configuration, std::move(dependencies));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue