How to stop a memory leak in javascript? (appendChild/remove

wxdqz

New Member
My application performs the following on a time interval of 1/2 sec:

myTimeIntervalRoutine(objindex)
{
var myObj = objList[objIndex];

if (myObj.m_scriptNode)
myObj.m_span.removeChild(myObj.m_scriptNode);

myObj.m_scriptNode=document.createElement('script');
myObj.m_scriptNode.type='text/javascript';
myObj.m_scriptNode.src = myObj.m_url;

myObj.m_span.appendChild(myObj.m_scriptNode);
}

The script pointed to by m_url contains only a comment (in order to eliminate that script as a possibility). When I run my application, this time interval routine is the only javascript being exercised and internet explorer slowly increases in size perhaps 4k a second.

Any ideas? I don't see anything wrong with the code but Im still very new at JS.
 
Back
Top