以下代码是否会导致内存泄漏?
var MyOptions = Backbone.Collection.extend({
url: "data1.php"
})
options = new MyOptions();
var MyOtherOptions = Backbone.Collection.extend({
url: "data2.php"
})
options = new MyOtherOptions();
// will the Backbone collection object with url
// "data1.php" be garbage collected somehow?
我不熟悉javascript的内存机制。问题出现在C程序员的预感中。