summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qjni_p.h
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-02-25 11:23:46 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-02-25 11:23:46 +0000
commit2cac171ddedfecdfc6fa27c5326f9eebfab1822e (patch)
treeff8e7c162875d7374ddc42224a91533b7e8c8663 /src/corelib/kernel/qjni_p.h
parent5113fdeb7d50979c6acbe2c9c5b26ad134614873 (diff)
parent709e40093e6081b18e0d3003e0a088e1a9b6f211 (diff)
Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/dev
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 a7859a800f..e79caed5b8 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;