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

Commit edd4a227 authored by Eric Laurent's avatar Eric Laurent Committed by Android (Google) Code Review
Browse files

Merge "audiosystem JNI: check env pointer before use." into lmp-mr1-dev

parents 850ec91e 449c5887
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -160,6 +160,9 @@ JNIAudioPortCallback::~JNIAudioPortCallback()
{
    // remove global references
    JNIEnv *env = AndroidRuntime::getJNIEnv();
    if (env == NULL) {
        return;
    }
    env->DeleteGlobalRef(mObject);
    env->DeleteGlobalRef(mClass);
}
@@ -167,7 +170,9 @@ JNIAudioPortCallback::~JNIAudioPortCallback()
void JNIAudioPortCallback::sendEvent(int event)
{
    JNIEnv *env = AndroidRuntime::getJNIEnv();

    if (env == NULL) {
        return;
    }
    env->CallStaticVoidMethod(mClass, gPostEventFromNative, mObject,
                              event, 0, 0, NULL);
    if (env->ExceptionCheck()) {