Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07799984 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio effect JNI: fix global ref leak.

Remove one more global ref leak in AudioEffect
and Visualizer JNI.

Bug: 21629892.
Change-Id: Id77fc2d10f3dc9d3154d6a1cf0f8cc0f83683584
parent 45bb0ca4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -472,6 +472,8 @@ static void android_media_AudioEffect_native_release(JNIEnv *env, jobject thiz)

    if (lpJniStorage) {
        ALOGV("deleting pJniStorage: %p\n", lpJniStorage);
        env->DeleteGlobalRef(lpJniStorage->mCallbackData.audioEffect_class);
        env->DeleteGlobalRef(lpJniStorage->mCallbackData.audioEffect_ref);
        delete lpJniStorage;
    }
}
+2 −0
Original line number Diff line number Diff line
@@ -450,6 +450,8 @@ static void android_media_visualizer_native_release(JNIEnv *env, jobject thiz)

    if (lpJniStorage) {
        ALOGV("deleting pJniStorage: %p\n", lpJniStorage);
        env->DeleteGlobalRef(lpJniStorage->mCallbackData.visualizer_class);
        env->DeleteGlobalRef(lpJniStorage->mCallbackData.visualizer_ref);
        delete lpJniStorage;
    }
}