javascript - Memory leak in Firefox with jQuery, AJAX, and HTML5 canvas -
i'm polling server using jquery's ajax function , using data update canvas. poll server once each second (this not done using setinterval(), in case you're wondering... did hear source of these issues. canvas animated, , keep track of frame rate. use data figure out when second has elapsed). isn't issue in chrome, in firefox , maxthon cloud (and much lesser degree opera), performance gradually grows worse , worse. think it's ajax calls, , have no idea how fix issue. here "callserver()" function, if that's of use. thanks!
function callserver(action, json) { if(!json) { $.ajax({ type: 'post', url: 'okey.php.', data: 'action=' + action, cache: false, success: function(data) { switch(action) { case 'ptv': tilesvalue = data; break; case 'ptc': tilescolor = data; break; case 'tid': //alert(data); thisplayerid = data; break; case 'pti': playerturninfo = data; //alert(data); break; case 'gs': gamestatus = data; break; case 'steal': alert(data); break; case 'draw': alert(data); break; case 'testing': alert(data); break; } } }); } else if(json) { $.ajax({ type: 'post', url: 'okey.php.', data: 'action=' + action, datatype: 'json', cache: false, success: function(data) { switch(action) { case 'ptv': tilesvalue = data; break; case 'ptc': tilescolor = data; //alert(tilescolor.length); break; case 'pn': playernames = data; break; case 'pid': playerids = data; break; case 'pts': //alert("excellent"); turnstatuses = data; break; case 'ti': tileindeces = data; //alert(tileindeces.length) break; case 'dis': //alert(parseint(data[3])); discarded = data; //alert(parseint(discarded[3])); break; } } }); } }
update: not frequency of calls causing issue.
Comments
Post a Comment