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:
deadbeef
2017-05-18 08:45:59 -07:00
committed by Commit bot
parent 3184f8e329
commit 119c407848

View File

@ -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: