On Fri, Aug 7, 2020 at 3:07 PM Alexandr Miloslavskiy
<alexandr.miloslavs...@syntevo.com> wrote:
>
> Please find test snippet and patch attached.
>
> [[[
> Fix JavaHL crash in TunnelAgent.CloseTunnelCallback after GC
>
> When jobject reference is kept across different JNI calls, a new global
> reference must be requested with NewGlobalRef(). Otherwise, GC is free
> to remove the object. Even if Java code keeps a reference to the object,
> GC can still move the object around, invalidating the kept jobject,
> which results in a native crash when trying to access it.
>
> [in subversion/bindings/javahl]
> * native/OperationContext.cpp
>    (OperationContext::openTunnel): Add NewGlobalRef() for kept jobject.
>    (OperationContext::closeTunnel): Add a matching DeleteGlobalRef().
> ]]]

Ping... this is the 2nd patch. Review would be appreciated :-)

Thanks,
Nathan

Reply via email to