Fix init_jni_vars for abstract classes.

This commit is contained in:
levlam 2023-04-28 16:43:13 +03:00
parent b9d431ccac
commit bde874c1e7

View File

@ -631,8 +631,13 @@ std::string TD_TL_writer_jni_cpp::gen_additional_proxy_function_begin(const std:
"void " +
class_name + "::" + function_name +
"(JNIEnv *env) {\n"
" Class = jni::get_jclass(env, " +
gen_java_class_name(class_name) + ");\n";
" static bool is_inited = [&] {\n"
" Class = jni::get_jclass(env, " +
gen_java_class_name(class_name) +
");\n"
" return true;\n"
" }();\n"
" (void)is_inited;\n";
}
std::string TD_TL_writer_jni_cpp::gen_additional_proxy_function_case(const std::string &function_name,