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

Commit dd65a4f7 authored by Narayan Kamath's avatar Narayan Kamath Committed by Android Git Automerger
Browse files

am ea4cdd44: Merge "Race-condition in SoundPool during release"

* commit 'ea4cdd44':
  Race-condition in SoundPool during release
parents 3d6cfe0e ea4cdd44
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -231,14 +231,14 @@ android_media_SoundPool_SoundPoolImpl_release(JNIEnv *env, jobject thiz)
    SoundPool *ap = MusterSoundPool(env, thiz);
    if (ap != NULL) {

        // release weak reference
        // release weak reference and clear callback
        jobject weakRef = (jobject) ap->getUserData();
        ap->setCallback(NULL, NULL);
        if (weakRef != NULL) {
            env->DeleteGlobalRef(weakRef);
        }

        // clear callback and native context
        ap->setCallback(NULL, NULL);
        // clear native context
        env->SetLongField(thiz, fields.mNativeContext, 0);
        delete ap;
    }