Fixing memory leak of generated session descriptions on Android.
SessionDescriptionObserver::OnSuccess takes ownership of the description, but it doesn't use a unique_ptr, so the JNI code was neglecting to delete it. BUG=webrtc:7680 Review-Url: https://codereview.webrtc.org/2886263003 Cr-Commit-Position: refs/heads/master@{#18200}
This commit is contained in:
@ -658,6 +658,9 @@ class SdpObserverWrapper : public T {
|
||||
jobject j_sdp = JavaSdpFromNativeSdp(jni(), desc);
|
||||
jni()->CallVoidMethod(*j_observer_global_, m, j_sdp);
|
||||
CHECK_EXCEPTION(jni()) << "error during CallVoidMethod";
|
||||
// OnSuccess transfers ownership of the description (there's a TODO to make
|
||||
// it use unique_ptr...).
|
||||
delete desc;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user