Merge pull request #25 from WenhaiLin/master

bump external version to 'v3-deps-3'
This commit is contained in:
Wenhai Lin
2016-04-13 19:53:04 +08:00
3 changed files with 10 additions and 9 deletions
@@ -47,7 +47,7 @@ extern "C" {
JNIEXPORT jstring JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeGetContentText() {
JNIEnv * env = 0;
if (JniHelper::getJavaVM()->GetEnv((void**)&env, JNI_VERSION_1_4) != JNI_OK || ! env) {
if (JniHelper::getJavaVM()->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK || ! env) {
return 0;
}
std::string pszText = cocos2d::IMEDispatcher::sharedDispatcher()->getContentText();
@@ -86,7 +86,7 @@ namespace cocos2d {
JNIEnv* JniHelper::cacheEnv(JavaVM* jvm) {
JNIEnv* _env = nullptr;
// get jni environment
jint ret = jvm->GetEnv((void**)&_env, JNI_VERSION_1_4);
jint ret = jvm->GetEnv((void**)&_env, JNI_VERSION_1_6);
switch (ret) {
case JNI_OK :
@@ -97,11 +97,12 @@ namespace cocos2d {
case JNI_EDETACHED :
// Thread not attached
if (jvm->AttachCurrentThread(&_env, nullptr) < 0)
{
LOGE("Failed to get the environment using AttachCurrentThread()");
return nullptr;
} else {
{
LOGE("Failed to get the environment using AttachCurrentThread()");
return nullptr;
}
else
{
// Success : Attached and obtained JNIEnv!
pthread_setspecific(g_key, _env);
return _env;
@@ -109,7 +110,7 @@ namespace cocos2d {
case JNI_EVERSION :
// Cannot recover from this error
LOGE("JNI interface version 1.4 not supported");
LOGE("JNI interface version 1.6 not supported");
default :
LOGE("Failed to get the environment using GetEnv()");
return nullptr;
+1 -1
View File
@@ -1,5 +1,5 @@
{
"version":"v3-deps-2",
"version":"v3-deps-3",
"zip_file_size":"51659510",
"repo_name":"cocos2d-x-lite-external",
"repo_parent":"https://github.com/WenhaiLin/"