Further JNI memory leak fixes
Rene Schneider
Branch: S1artie/java-cef:further-memleak-fixes
Branch: chromiumembedded/java-cef:master
Declined
Declined pull request
Manually merged in master revisions af30919 and 57e46ac.
Closed by: Marshall Greenblatt·2018-10-30
Memory fixes for issue 167
Fixed memory leaks caused by retained JNI local refs
This commit is an addendum to commit faa96f8 of Francisco Vega found on git@bitbucket.org:francisco_vega/java-cef.git
I recently ran into the same JNI memory leaks as Francisco Vega and implemented the pretty-straightforward-but-tedious fixes into the various handlers' native code. I just wanted to provide a pull request with my changes, when I noticed that he found the same problem and was faster with his PR . However, as I attempted to find and eliminate all the spots with local references I still have some more fixes for some more spots on my branch and decided to provide a pull request with those as well.
For easier integration I first took his changes verbatim and then merged my additional fixes onto them, so my commit 8264508 (https://bitbucket.org/S1artie/java-cef/commits/8264508d3020c068e56dd59cb4de883eae84be8c?at=further-memleak-fixes) can be applied on top of Franciscos' first batch of fixes with no conflicts.
I have tested the fixed jcef native lib with a memory profiler and a simple test that reloads pages and performs JS on them which receives and pushes messages over the message router. That test confirmed that not a single JNI memory leak seemed to remain. However, I did NOT test the more exotic handlers like file dialogs, as I don’t have a use case for them.