##// END OF EJS Templates
on("destroy",...) -> once("destroy",...) so we don't keep a reference to it, preventing gc...
Jason Grout -
Show More
@@ -11,7 +11,7 define([
11 this.update_bindings(model.previous("widgets") || [], value);
11 this.update_bindings(model.previous("widgets") || [], value);
12 this.update_value(this.get("widgets")[0]);
12 this.update_value(this.get("widgets")[0]);
13 }, this);
13 }, this);
14 this.on("destroy", function(model, collection, options) {
14 this.once("destroy", function(model, collection, options) {
15 this.update_bindings(this.get("widgets"), []);
15 this.update_bindings(this.get("widgets"), []);
16 }, this);
16 }, this);
17 },
17 },
@@ -46,7 +46,7 define([
46 var DirectionalLinkModel = widget.WidgetModel.extend({
46 var DirectionalLinkModel = widget.WidgetModel.extend({
47 initialize: function() {
47 initialize: function() {
48 this.on("change", this.update_bindings, this);
48 this.on("change", this.update_bindings, this);
49 this.on("destroy", function() {
49 this.once("destroy", function() {
50 if (this.source) {
50 if (this.source) {
51 this.source[0].off("change:" + this.source[1], null, this);
51 this.source[0].off("change:" + this.source[1], null, this);
52 }
52 }
General Comments 0
You need to be logged in to leave comments. Login now