jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); java_obj = ToGlobalRef(env, java_obj); SetSlotMessage msg(js_obj, slot, java_obj); sendMessage(env, &msg); env->DeleteGlobalRef(java_obj);
MRJPluginInstance* pluginInstance = GetCurrentInstance(env); if (pluginInstance == NULL) { env->ThrowNew(env->FindClass("java/lang/NullPointerException"), "illegal JNIEnv (can't find plugin)"); return; }  jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj); java_obj = ToGlobalRef(env, java_obj);  SetSlotMessage msg(pluginInstance, js_obj, slot, java_obj); sendMessage(env, &msg); env->DeleteGlobalRef(java_obj);
Java_netscape_javascript_JSObject_setSlot(JNIEnv* env,                                          jobject java_wrapper_obj,                                          jint slot,                                          jobject java_obj){	jsobject js_obj = Unwrap_JSObject(env, java_wrapper_obj);	java_obj = ToGlobalRef(env, java_obj);	SetSlotMessage msg(js_obj, slot, java_obj);	sendMessage(env, &msg);	env->DeleteGlobalRef(java_obj);}