jni: Ensure global ref of client is created during async call.
Sometimes a java client gets garbage collected while an async
startcall is happening. This cleans up the ref count for the go client,
which causes a panic when we try to invoke start call.
This changes creates a general way for DoAsyncCall to release resources
(ie. call DeleteGlobalRef) after the call is complete. For this particular
problem, this allows us to create a global ref for the java client,
preventing it from being collected during the duration of startcall.
Change-Id: Ifadeabbc374aee2c3ab4320eb1dcb7e2e1c1c7f9
1 file changed