Closed javenwang closed 10 years ago
Why would you want that? Its more safe to reference the object itself rather than this.
Hi @viezel , as mentioned in my comment, the xhr won't be released because there is a cycle reference between xhr and its onxxx callback. i think that is the reason causing https://github.com/viezel/napp.alloy.adapter.restapi/issues/27.
You can download the attachment from https://jira.appcelerator.org/browse/ALOY-915 and verify by yourself.
In Titanium document (http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.Network.HTTPClient-property-onload)
To access response data and headers, access the HTTPClient object itself (accessible as this during the callback, or the source property of the callback event).
fair enough.. ill merge it.
during the onload/onerror callback, we should use 'this' to access responseText and status or xhr will not be released. this commit will fix https://github.com/viezel/napp.alloy.adapter.restapi/issues/27