Skip to content

Commit

Permalink
fix(jni): delete local ref
Browse files Browse the repository at this point in the history
  • Loading branch information
I-m-SuperMan authored and pingkai committed Jun 11, 2020
1 parent bd2ca4b commit 01cc6e0
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,18 @@ MediaPlayerConfig JavaPlayerConfig::convertTo(JNIEnv *env, jobject playerConfig)
for (int i = 0; i < len; i++) {
jstring header = static_cast<jstring>(env->GetObjectArrayElement(
headersArray, i));
GetStringUTFChars tmpHeader(env, header);
char *ch_header = tmpHeader.getChars();
{
GetStringUTFChars tmpHeader(env, header);
char *ch_header = tmpHeader.getChars();

if (ch_header != nullptr) {
config.customHeaders.push_back(std::string(ch_header));
if (ch_header != nullptr) {
config.customHeaders.push_back(std::string(ch_header));
}
}
env->DeleteLocalRef(header);
}
}
}

return config;
}
}

0 comments on commit 01cc6e0

Please sign in to comment.