diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2024-03-22 01:21:09 +0200 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2024-04-04 19:12:55 +0000 |
commit | 0a4599637657375517fcaf35177d8c7bac302556 (patch) | |
tree | 8a3f23536be40d57d77d40082d249c2f3c704dba /tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt | |
parent | 14610fb1749a22abbd203f42e3edb3f4425cb215 (diff) |
JNI: check for pending exception first in getCleanJniObject()
returning early if the object is null will not clear pending exceptions
from the previous failed JNI call, and that will crash the app on the
next jni call if an explicit exception clearing is not done, wish mostly
the case. Checking and clearing for exceptions has to always be done
under this call.
Pick-to: 6.7
Fixes: QTBUG-122135
Change-Id: I0d42d012a4d1305fa07147fd22860d7c005f9b83
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Diffstat (limited to 'tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt')
-rw-r--r-- | tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java b/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java index faa33a6bac..07a94d1cac 100644 --- a/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java +++ b/tests/auto/corelib/kernel/qjniobject/testdata/src/org/qtproject/qt/android/testdata/QtJniObjectTestClass.java @@ -334,4 +334,12 @@ public class QtJniObjectTestClass { return callbackWithStringList(value); } + + public Object callMethodThrowsException() throws Exception { + throw new Exception(); + } + + public static Object callStaticMethodThrowsException() throws Exception { + throw new Exception(); + } } |