joeferner/node-java — pull request #161 by facboy (2014-09-28 19:52:31+00:00)
Title: Fix dynamic proxy unref() so that it can be called from Js and Java.

When I refactored the dynamic proxies to only create the Java dynamic proxy once, I managed to break unref() so that it wasn't callable from Js any more. It also had the side-effect of making it possible to call the js functions from Node through the Java dynamic proxy, which resulted in some pretty odd behaviour (seg-faults, deadlocks if you use synchronization, etc).

I've fixed the unref() problem, and also made it so that the 'Js side' of the dynamic proxy only has an unref() method and an 'invocationHandler' field that returns the original 'functions' object that the proxy was created with. I can't see why anyone would want to call the Js functions from Node via java, and in the absence of a compelling reason to do so I'd rather not try and work out what is causing the seg-faults and deadlocks (I imagine it's some JNI threading problem, as always!)