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

Commit 4b473fa3 authored by Hongguang's avatar Hongguang Committed by Hongguang Chen
Browse files

Fix abort when DeleteWeakGlobalRef in ~FrontendClientCallbackImpl()

This week global ref was newed once bug deleted twice. It triggered an
abort on userdebug build when checkJni is enabled.

Bug: 195591944
Fix: 195591944
Test: atest android.media.tv.tuner.cts
Change-Id: I0b46628a0fc192708201c3c8b536b7ad1a4ea8f1
parent e8e2b078
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1245,7 +1245,8 @@ jobject JTuner::openFrontendByHandle(int feHandle) {
        return NULL;
    }

    sp<FrontendClientCallbackImpl> feClientCb = new FrontendClientCallbackImpl(mObject);
    sp<FrontendClientCallbackImpl> feClientCb =
            new FrontendClientCallbackImpl(env->NewWeakGlobalRef(mObject));
    mFeClient->setCallback(feClientCb);
    // TODO: add more fields to frontend
    return env->NewObject(