wrong variable used which could crash the whole app

This commit is contained in:
Michael Contento 2013-09-23 11:50:34 +02:00
parent 635f394e93
commit 09543a0aac
1 changed files with 3 additions and 3 deletions

View File

@ -254,13 +254,13 @@ namespace cocos2d {
}
JNIEnv *pEnv = JniHelper::getEnv();
if (!env) {
if (!pEnv) {
return NULL;
}
const char* chars = env->GetStringUTFChars(jstr, NULL);
const char* chars = pEnv->GetStringUTFChars(jstr, NULL);
std::string ret(chars);
env->ReleaseStringUTFChars(jstr, chars);
pEnv->ReleaseStringUTFChars(jstr, chars);
return ret;
}