Skip to content

Commit

Permalink
fix memory issue in MediaInputMgr (#13494)
Browse files Browse the repository at this point in the history
  • Loading branch information
xylophone21 authored Jan 12, 2022
1 parent 585e9d9 commit 34e4032
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/tv-app/android/java/MediaInputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ bool MediaInputManager::HandleHideInputStatus()

bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharSpan & name)
{
std::string inputname(name.data(), name.size());
jboolean ret = JNI_FALSE;
JNIEnv * env = JniReferences::GetInstance().GetEnvForCurrentThread();

Expand All @@ -232,7 +233,7 @@ bool MediaInputManager::HandleRenameInput(const uint8_t index, const chip::CharS
VerifyOrExit(env != NULL, ChipLogError(Zcl, "env null"));

{
UtfString jniInputname(env, name.data());
UtfString jniInputname(env, inputname.data());
env->ExceptionClear();
ret =
env->CallBooleanMethod(mMediaInputManagerObject, mRenameInputMethod, static_cast<jint>(index), jniInputname.jniValue());
Expand Down

0 comments on commit 34e4032

Please sign in to comment.