diff options
author | BogDan Vatra <bogdan@kde.org> | 2020-01-20 16:50:21 +0200 |
---|---|---|
committer | BogDan Vatra <bogdan@kde.org> | 2020-01-22 10:07:32 +0200 |
commit | 3bbd21ccc40805fce3437cf95bb238fc52bbf026 (patch) | |
tree | b8c55d06b59dffdd95bfef985cfe107a8a9a9bba /src | |
parent | 6c23f006e07b774b0eef863cccd36a992274ca32 (diff) |
Release the local ref immediately
The local refs are released by the JVM when we exit the function, but if
we need tons of local refs, JVM will not be happy.
Fixes: QTBUG-81077
Change-Id: Ic38a5be1a563cb9c2465f9f902ff6ae6c61e698b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp index fcc08ea00d..625473964d 100644 --- a/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp +++ b/src/plugins/platforms/android/qandroidassetsfileenginehandler.cpp @@ -146,7 +146,7 @@ public: jobjectArray jFiles = static_cast<jobjectArray>(files.object()); const jint nFiles = env->GetArrayLength(jFiles); for (int i = 0; i < nFiles; ++i) { - AssetItem item{QJNIObjectPrivate(env->GetObjectArrayElement(jFiles, i)).toString()}; + AssetItem item{QJNIObjectPrivate::fromLocalRef(env->GetObjectArrayElement(jFiles, i)).toString()}; insert(std::upper_bound(begin(), end(), item, [](const auto &a, const auto &b){ return a.name < b.name; }), item); |