appcelerator/titanium_mobile — pull request #2687 by joshthecoder (2012-08-07 07:46:40+00:00)
Title: [TIMOB-10093] Android: HTTPClient leaks function callbacks (ex: onload, ondatastream)

This resolves a memory leak caused by the HTTPClient retaining a reference
to the JavaScript callback functions. The result would be a circular reference
of the HTTPClient (its retained by the callback function's scope).

I introduce a new API that allows calling properties on a proxy
object that are function from Java. This works around the circular reference issue
since it requires no extra referencing since the callbacks are kept alive anyway
since they are properties of the proxy.

See the JIRA ticket for a test case and instructions.