summaryrefslogtreecommitdiff
path: root/libs/samba/src/main/cpp/jni.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/samba/src/main/cpp/jni.hpp')
-rw-r--r--libs/samba/src/main/cpp/jni.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/samba/src/main/cpp/jni.hpp b/libs/samba/src/main/cpp/jni.hpp
index b9bdb69..aa79bbe 100644
--- a/libs/samba/src/main/cpp/jni.hpp
+++ b/libs/samba/src/main/cpp/jni.hpp
@@ -48,7 +48,7 @@ class Ref {
virtual T release_to_local() = 0;
virtual void del() = 0;
- JNIEnv* env_;
+ JNIEnv* env_{nullptr};
T ptr_;
};
@@ -134,14 +134,14 @@ class GlobalRef : public Ref<T> {
free();
if (other) {
auto* env = AttachCurrentThread();
- this->ptr_ = other ? static_cast<T>(env->NewGlobalRef(static_cast<jobject>(other.get()))) : nullptr;
+ this->ptr_ = static_cast<T>(env->NewGlobalRef(static_cast<jobject>(other.get())));
} else {
this->ptr_ = nullptr;
}
return *this;
}
- GlobalRef& operator=(GlobalRef<T>&& other) {
+ GlobalRef& operator=(GlobalRef<T>&& other) noexcept {
free();
this->ptr_ = other.ptr_;
other.ptr_ = nullptr;