summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjni_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qjni_p.h')
-rw-r--r--src/corelib/kernel/qjni_p.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/kernel/qjni_p.h b/src/corelib/kernel/qjni_p.h
index 5f573624c6..fb1982dc74 100644
--- a/src/corelib/kernel/qjni_p.h
+++ b/src/corelib/kernel/qjni_p.h
@@ -84,7 +84,10 @@ public:
QJNIObjectPrivate(const char *className, const char *sig, ...);
explicit QJNIObjectPrivate(jclass clazz);
QJNIObjectPrivate(jclass clazz, const char *sig, ...);
- QJNIObjectPrivate(jobject obj);
+ // In most cases you should never call this function with a local ref. unless you intend
+ // to manage the local ref. yourself.
+ // NOTE: see fromLocalRef() for converting a local ref. to QJNIObjectPrivate.
+ explicit QJNIObjectPrivate(jobject globalRef);
template <typename T>
T callMethod(const char *methodName,
@@ -183,6 +186,9 @@ public:
return *this;
}
+ // This function takes ownership of the jobject and releases the local ref. before returning.
+ static QJNIObjectPrivate fromLocalRef(jobject lref);
+
private:
friend class QAndroidJniObject;