16 template < RefDeletionMethod DeleteRef >
45 template < RefDeletionMethod DeleteRef >
60 JNIEnv* env =
nullptr;
61 jint err = vm->GetEnv(
reinterpret_cast<void**
>(&env), JNI_VERSION_1_1);
64 (env->*DeleteRef)(
Unwrap(p));
66 else if (err == JNI_EDETACHED)
84 template < RefDeletionMethod DeleteRef >
99 JNIEnv* env =
nullptr;
100 jint err = vm->GetEnv(
reinterpret_cast<void**
>(&env), JNI_VERSION_1_1);
103 (env->*DeleteRef)(
Unwrap(p));
105 else if (err != JNI_EDETACHED)
Definition advanced_ownership.hpp:47
EnvAttachingDeleter(JNIEnv &e)
Definition advanced_ownership.hpp:53
EnvAttachingDeleter()=default
void operator()(jobject *p) const
Definition advanced_ownership.hpp:55
Definition advanced_ownership.hpp:18
void operator()(jobject *p) const
Definition advanced_ownership.hpp:26
EnvGettingDeleter(JNIEnv &e)
Definition advanced_ownership.hpp:24
EnvGettingDeleter()=default
Definition advanced_ownership.hpp:86
EnvIgnoringDeleter()=default
EnvIgnoringDeleter(JNIEnv &e)
Definition advanced_ownership.hpp:92
void operator()(jobject *p) const
Definition advanced_ownership.hpp:94
Definition advanced_ownership.hpp:6
void CheckErrorCode(jint err)
Definition errors.hpp:43
JavaVM & GetJavaVM(JNIEnv &env)
Definition functions.hpp:598
UniqueEnv AttachCurrentThread(JavaVM &vm)
Definition functions.hpp:631
JNIEnv & GetEnv(JavaVM &vm, version version=jni_version_1_1)
Definition functions.hpp:659
auto Unwrap(W &&w)
Definition wrapping.hpp:22