persvr / rql

Resource Query Language
http://www.persvr.org/
269 stars 49 forks source link

or() doesn't clean up __rqlId attributes #65

Open dmartin-gh opened 9 years ago

dmartin-gh commented 9 years ago

In js-array.js, the or() function attempts to clean up its temporary '__rqlId' attributes using:

// cleanup markers
for(var i = 0, l = items.length; i < l; i++){
    delete items[idProperty];
}

This should be:

// cleanup markers
for(var i = 0, l = items.length; i < l; i++){
    delete items[i][idProperty];
}

With enough objects and frequent enough queries, this can lead to a substantial memory leak.