Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1577)

Unified Diff: webrtc/sdk/android/api/org/webrtc/PeerConnection.java

Issue 3013573002: Add javadoc comment around PeerConnection.dispose. (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/sdk/android/api/org/webrtc/PeerConnection.java
diff --git a/webrtc/sdk/android/api/org/webrtc/PeerConnection.java b/webrtc/sdk/android/api/org/webrtc/PeerConnection.java
index f98b2e4b6756a616d21799a2d2ccc190cfb1794a..9ddfdfdc06f2a8cb2b81958a331ff5c943d0fd41 100644
--- a/webrtc/sdk/android/api/org/webrtc/PeerConnection.java
+++ b/webrtc/sdk/android/api/org/webrtc/PeerConnection.java
@@ -489,6 +489,22 @@ public class PeerConnection {
public native void close();
+ /**
+ * Free native resources associated with this PeerConnection instance.
+ * <p>
+ * This method removes a reference count from the C++ PeerConnection object,
+ * which should result in it being destroyed. It also calls equivalent
+ * "dispose" methods on the Java objects attached to this PeerConnection
+ * (streams, senders, receivers), such that their associated C++ objects
+ * will also be destroyed.
+ * <p>
+ * Note that this method cannot be safely called from an observer callback
+ * (PeerConnection.Observer, DataChannel.Observer, etc.). If you want to, for
+ * example, destroy the PeerConnection after an "ICE failed" callback, you
+ * must do this asynchronously (in other words, unwind the stack first). See
+ * <a href="https://bugs.chromium.org/p/webrtc/issues/detail?id=3721">bug
+ * 3721</a> for more details.
+ */
public void dispose() {
close();
for (MediaStream stream : localStreams) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698