diff options
Diffstat (limited to 'libs/samba/src/main')
| -rw-r--r-- | libs/samba/src/main/cpp/jni.hpp | 6 | ||||
| -rw-r--r-- | libs/samba/src/main/cpp/samba.cpp | 2 |
2 files changed, 4 insertions, 4 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; diff --git a/libs/samba/src/main/cpp/samba.cpp b/libs/samba/src/main/cpp/samba.cpp index 302fb3a..ed73d62 100644 --- a/libs/samba/src/main/cpp/samba.cpp +++ b/libs/samba/src/main/cpp/samba.cpp @@ -406,7 +406,7 @@ void RegisterSamba(JNIEnv* env) { } void UnregisterSamba() { - g_CreateDirEntry = 0; + g_CreateDirEntry = nullptr; g_NativeSambaClass.reset(); g_DirEntryClass.reset(); } |
