Merge "Fix abort when DeleteWeakGlobalRef in ~FrontendClientCallbackImpl()"

This commit is contained in:
Hongguang Chen
2021-08-05 04:51:37 +00:00
committed by Android (Google) Code Review

View File

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