mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-21 16:12:40 +08:00
[CocosPlay-Android]Fixed crash on single process application.
This commit is contained in:
@@ -52,7 +52,7 @@ extern "C"
|
||||
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
|
||||
{
|
||||
JniHelper::setJavaVM(vm);
|
||||
cocos_android_app_init(JniHelper::getEnv());
|
||||
|
||||
return JNI_VERSION_1_6;
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ JNIEXPORT void Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeInit(JNIEnv* env, jo
|
||||
glview->setFrameSize(w, h);
|
||||
director->setOpenGLView(glview);
|
||||
|
||||
cocos_android_app_init(env);
|
||||
cocos2d::Application::getInstance()->run();
|
||||
}
|
||||
else
|
||||
@@ -91,7 +92,7 @@ JNIEXPORT jintArray Java_org_cocos2dx_lib_Cocos2dxActivity_getGLContextAttrs(JNI
|
||||
|
||||
|
||||
jintArray glContextAttrsJava = env->NewIntArray(6);
|
||||
env->SetIntArrayRegion(glContextAttrsJava, 0, 6, tmp);
|
||||
env->SetIntArrayRegion(glContextAttrsJava, 0, 6, tmp);
|
||||
|
||||
return glContextAttrsJava;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user