Index: Source/modules/mediastream/RTCPeerConnection.cpp |
diff --git a/Source/modules/mediastream/RTCPeerConnection.cpp b/Source/modules/mediastream/RTCPeerConnection.cpp |
index 9fa043f41ad084136ab707cbb02866952bb0f86f..eefcc587293f561d1a0b93f752355af056aa9b55 100644 |
--- a/Source/modules/mediastream/RTCPeerConnection.cpp |
+++ b/Source/modules/mediastream/RTCPeerConnection.cpp |
@@ -220,10 +220,9 @@ RTCPeerConnection::~RTCPeerConnection() |
// We are assuming that a wrapper is always created when RTCPeerConnection is created. |
ASSERT(m_closed || m_stopped); |
- // FIXME: Oilpan: We can't call stop here since it touches m_dataChannels. |
- // Another way to ensure that data channels are stopped at RTCPeerConnection |
- // destruction is needed. |
+#if !ENABLE(OILPAN) |
stop(); |
+#endif |
} |
void RTCPeerConnection::createOffer(PassOwnPtr<RTCSessionDescriptionCallback> successCallback, PassOwnPtr<RTCErrorCallback> errorCallback, const Dictionary& mediaConstraints, ExceptionState& exceptionState) |
@@ -742,12 +741,19 @@ void RTCPeerConnection::dispatchScheduledEvent() |
events.clear(); |
} |
+void RTCPeerConnection::clearWeakMembers(Visitor* visitor) |
+{ |
+ if (!visitor->isAlive(this) && m_closed) |
Mads Ager (chromium)
2014/06/18 08:19:50
This will not work because weak processing only ha
keishi
2014/06/18 08:56:58
Done.
|
+ stop(); |
+} |
+ |
void RTCPeerConnection::trace(Visitor* visitor) |
{ |
visitor->trace(m_localStreams); |
visitor->trace(m_remoteStreams); |
visitor->trace(m_dataChannels); |
visitor->trace(m_scheduledEvents); |
+ visitor->registerWeakMembers<RTCPeerConnection, &RTCPeerConnection::clearWeakMembers>(this); |
EventTargetWithInlineData::trace(visitor); |
} |