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>
This commit is contained in:
parent
6c23f006e0
commit
3bbd21ccc4
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user