mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 10:32:39 +08:00
Merge pull request #25 from WenhaiLin/master
bump external version to 'v3-deps-3'
This commit is contained in:
@@ -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;
|
||||
|
||||
Vendored
+1
-1
@@ -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/"
|
||||
|
||||
Reference in New Issue
Block a user