Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Would this code cause memory leakage?

Tags:

Would this cause memory leak ?

var mc:MovieClip ; //<<<<<<< OUTSIDE LOOP

for ( var i=0 ; i< 1000 ; i++)
{
   mc = new MovieClip() ;
   mc.addEventListener( MouseEvent.CLICK , onClick) ;
}

And what about this ?

for ( var i=0 ; i< 1000 ; i++)
{
  var mc:MovieClip ; //<<<<<<< INSIDE LOOP
   mc = new MovieClip() ;
   mc.addEventListener( MouseEvent.CLICK , onClick) ;
}

"removeEventListener" is not used in any of the above code, so I think that both are causing a memory leak.