This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Commit 209ecc5
committed
[[ Bug 21941 ]] Ensure calls into Java don't accumulate JNI local-refs
This patch fixes an issue where multiple calls into Java from LCB could
cause a local-ref table overflow on older Android OS versions.
The issue has been fixed by ensuring that all local-refs which are
generated by JNI calls are deleted when no longer used, rather than
assuming that they will be cleared up automatically by the JVM when
control is returned to Java.
To achieve this a new (templatized) auto class has been introduced:
MCJavaAutoLocalRef<T>. This holds a JNI object reference of type T
which it takes on construction, it then deletes the local-ref on
destruction. The auto-class casts automatically to T.1 parent 9a5b780 commit 209ecc5
File tree
2 files changed
+122
-49
lines changed- docs/notes
- libfoundation/src
2 files changed
+122
-49
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments