quick question about memory management in AS3

Posted by TheDarkIn1978 on Stack Overflow See other posts from Stack Overflow or by TheDarkIn1978
Published on 2010-04-09T02:40:03Z Indexed on 2010/04/09 2:43 UTC
Read the original article Hit count: 413

the following method will be called many times. i'm concerned the continuous call for new rectangles will add potentially unnecessary memory consumption, or is the memory used to produce the previous rectangle released/overwritten to accommodate another rectangle since it is assigned to the same instance variable?

private function onDrag(evt:MouseEvent):void
        {
        this.startDrag(false, dragBounds());
        }

private function dragBounds():Rectangle
    {
    var stagebounds = new Rectangle(0 - swatchRect.x, 0 - swatchRect.y, stage.stageWidth - swatchRect.width, stage.stageHeight - swatchRect.height);
    return stagebounds;
    }

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about memory-management