mirror of
https://github.com/netbirdio/gomobile-tvos-fork.git
synced 2026-05-22 18:43:29 -07:00
app: simplify and document init sequence
The global constructor added for -buildmode=c-shared takes care of a lot of the messier steps that were being done here. Change-Id: I00525765855b2ad0fcecb0639d6a7ee3feea9ed9 Reviewed-on: https://go-review.googlesource.com/9648 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
This commit is contained in:
@@ -188,9 +188,7 @@ void init_seq(void *javavm) {
|
||||
JNIEnv *env;
|
||||
int res = (*vm)->GetEnv(vm, (void**)&env, JNI_VERSION_1_6);
|
||||
if (res == JNI_EDETACHED) {
|
||||
JavaVMAttachArgs args;
|
||||
args.version = JNI_VERSION_1_6;
|
||||
if ((*vm)->AttachCurrentThread(vm, &env, &args) != 0) {
|
||||
if ((*vm)->AttachCurrentThread(vm, &env, NULL) != 0) {
|
||||
LOG_FATAL("cannot attach to current_vm");
|
||||
}
|
||||
} else if (res != 0) {
|
||||
|
||||
Reference in New Issue
Block a user