Use weak references to JCalls objects.
authorMatt Corallo <git@bluematt.me>
Mon, 12 Oct 2020 20:51:16 +0000 (16:51 -0400)
committerMatt Corallo <git@bluematt.me>
Mon, 12 Oct 2020 20:51:16 +0000 (16:51 -0400)
commit467650b45fcf2ac084054dfa3055cded3d4e42db
tree1ea3d457ea60514c336139da6281b01bbda980dc
parent3a4bb54b59dc8f7362099a81d33c936abb0a312f
Use weak references to JCalls objects.

This fixes a future usability issue where its easy to create a
lambda which ends up referencing a high-level struct's owning class
and then have the high-level struct hold a global reference to the
lambda, creating a reference cycle that java can't see into.

instead, we require the user hold a reference to the lambda as
long as the parent exists, something which we can automate on the
java bindings end.
genbindings.py
src/main/jni/bindings.c
src/test/java/org/ldk/PeerTest.java