views:

28

answers:

0

Hi,

I noticed that NetConnection leaks memory

var nc:NetConnection = new NetConnection();

var o = new Object();

o.onResult = function  () {
    trace ("onResult");
    nc.close();
    loadData();
}

nc.onStatus = function  () {
    trace ("onStatus");
    nc.close();
    loadData();
}


function loadData () {
        // some amf service uri here
    nc.connect("http://www.yahoo.com/");
    nc.call("methodName", o);
}

loadData();

As you can see I use same NetConnection, no new objects are created, but with every load increases.

Maybe anyone could suggest a workaround to solve this?