diff options
author | Sven Gothel <[email protected]> | 2022-05-05 08:30:06 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-05-05 08:30:06 +0200 |
commit | 405ff0f76d88523cb9c02ee23eb4e920c8982478 (patch) | |
tree | 39b2e4553c4061cb4323e3fd5dac409e2a78e460 | |
parent | c09cfe41013dc1167c8e98cba919402b2f77e7fd (diff) |
JavaGlobalObj: Fix copy-ctor and add move-ctor. Both correspond to their JNIGlobalRef counterpart
-rw-r--r-- | include/jau/jni/helper_jni.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/jau/jni/helper_jni.hpp b/include/jau/jni/helper_jni.hpp index 78485a6..0590766 100644 --- a/include/jau/jni/helper_jni.hpp +++ b/include/jau/jni/helper_jni.hpp @@ -184,9 +184,12 @@ namespace jau { JavaGlobalObj(jobject obj, jmethodID mNotifyDeleted_) noexcept : javaObjectRef(obj), mNotifyDeleted(mNotifyDeleted_) { } - JavaGlobalObj(JNIGlobalRef obj, jmethodID mNotifyDeleted_) noexcept + JavaGlobalObj(const JNIGlobalRef& obj, jmethodID mNotifyDeleted_) noexcept : javaObjectRef(obj), mNotifyDeleted(mNotifyDeleted_) { } + JavaGlobalObj(JNIGlobalRef && obj, jmethodID mNotifyDeleted_) noexcept + : javaObjectRef(std::move(obj)), mNotifyDeleted(mNotifyDeleted_) { } + JavaGlobalObj(const JavaGlobalObj &o) noexcept = default; JavaGlobalObj(JavaGlobalObj &&o) noexcept = default; JavaGlobalObj& operator=(const JavaGlobalObj &o) noexcept = default; |