| 934 | } |
| 935 | |
| 936 | static int lua_java_instance_gc(lua_State* L) { |
| 937 | jobject* ud = (jobject*)luaL_checkudata(L, 1, JAVA_INSTANCE_MT); |
| 938 | jobject instance = *ud; |
| 939 | |
| 940 | if (instance) { |
| 941 | JNIEnv* env = get_jni_env(); |
| 942 | if (env) { |
| 943 | (*env)->DeleteGlobalRef(env, instance); |
| 944 | } |
| 945 | } |
| 946 | |
| 947 | return 0; |
| 948 | } |
| 949 | |
| 950 | static const luaL_Reg java_wrapper_methods[] = { |
| 951 | {"new", lua_java_new}, |
nothing calls this directly
no test coverage detected