[TIMOB-20446] iOS: HTTPClient fails to deallocate
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2017-04-13T05:32:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | 5.1.0, 5.2.0, HttpClient, ios, leak |
Reporter | Mike Stancliffe |
Assignee | Vijay Singh |
Created | 2016-02-18T21:39:19.000+0000 |
Updated | 2017-05-31T23:17:42.000+0000 |
Description
HTTPClient iOS fails to deallocate. running the sample app below and using instruments, TiNetworkHTTPClientProxy never goes down, even after status is DONE, slowly eating up memory
See this behaviour in 5.2.0 RC(5.2.0.v20160216202526) as well as 5.1.2
var win1 = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var label1 = Titanium.UI.createLabel({
color:'#999',
text:'Ping Test',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
});
win1.add(label1);
function ping() {
var pingTimeStart = (new Date).getTime();
var pingTimeEnd = 0;
var url = 'http://www.google.com/';
var pingTest = Ti.Network.createHTTPClient();
pingTest.onload = function(e) {
pingTimeEnd = (new Date).getTime();
Ti.API.warn('PING COMPLETE : '+(pingTimeEnd-pingTimeStart));
};
pingTest.onerror = function(e) {
pingTimeEnd = (new Date).getTime();
Ti.API.error('PING FAIL : ' + (pingTimeEnd - pingTimeStart));
};
pingTest.open("HEAD", url);
pingTest.timeout = 2000;
pingTest.send();
}
var pingAway = setInterval(function() {
ping();
}, 10000);
win1.open();
This is duplicate of TIMOB-24364.
Closing ticket as duplicate.