diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2024-09-25 21:13:18 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2024-09-25 21:13:18 +0200 |
| commit | 750e8a772ca54599a4a7859f059d656d828e4b78 (patch) | |
| tree | 7396534bcd09f89c2cf919234007aecd687eb910 /libs/samba/src/main/cpp/jni.hpp | |
| parent | 574f4a278982dadf87fafb50038c5150b958b219 (diff) | |
samba: Follow clang-tidy suggestions
Diffstat (limited to 'libs/samba/src/main/cpp/jni.hpp')
| -rw-r--r-- | libs/samba/src/main/cpp/jni.hpp | 6 |
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; |
