Skip to content

Memory leak in Form.editors.List.setValue()  #517

@sniederb

Description

@sniederb

On the master, Form.editors.List.prototype.setValue() is

setValue: function(value) {
  this.value = value;`
  this.render();
},

The render() causes the view's $el to be replaced, without detaching the previous elements. I'm currently overwriting this:

Backbone.Form.editors.List.prototype.setValue = function(value) {
    this.value = value;
    if (!$.isArray(value)) {
        throw new Error("List value must be an array");
    }

    for (var i = 0; i < value.length; i++) {
        this.items[i].setValue(value[i]);
    }
};

If you agree with the change, would be nice to see that patched.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions