0

下面的代码会不会导致内存泄漏?

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 程序员的直觉中冒出来的。

4

0 回答 0