Memory Leak - Page 2
Memory Leak
This discussion has been closed.
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
© 2007-2025 MIT licensed. Privacy policy. Supporters.
SpryMedia Ltd is registered in Scotland, company no. SC456502.
Replies
if you look at zeroclipboard, you will see that every client (flash button) is added to .clients, and the nextId is increased. i noticed that after killing a table with tools and creating a new one with ajax, the .clients was still not empty. i checked the nextId, if i load my page the nextId is 1 at the start and 3 after adding 3 flash buttons, and if i destroy the table and empty() the div incl. the tabletools, and reload with ajax, the nextid starts with 4 and also the new client is added to .clients. maybe this prevents ie from collecting garbage ?
my solution (sorry, as i said i'm not an expert but it solves my problem):
add to tabletools the function:
"fnCleanUp": function ()
{
for ( var cli in ZeroClipboard_TableTools.clients )
{
if ( cli )
{
var client = ZeroClipboard_TableTools.clients[cli];
{
client.destroy();
}
}
}
ZeroClipboard_TableTools.clients={};
ZeroClipboard_TableTools.nextId=1;
}
and in the main page call it whenever a table is destroyed:
...
oTableTools.fnCleanUp();
$(table).dataTable().fnDestroy();
$("#dynamic").empty(); (this is the div used to display the table)
if (typeof(CollectGarbage) == "function")
{
CollectGarbage();
}
...