Skip to content
This repository was archived by the owner on Apr 2, 2019. It is now read-only.

ClientSideFilter .shadowCollection instance doesn't stopListening() on view.remove() #666

@myklemykle

Description

@myklemykle

Hi,

I've discovered a memory leak in one of the Backgrid views in our app. The view creates a ClientSideFilter instance at .filter, and that clientSideFilter instance creates its own instance (at .shadowCollection) of the collection we hand it. In our case, we hand it a collection that listens to events on other objects.

We call remove() on our view when we're done with it, which frees the view and the ClientSideFilter instance, but not its .shadowCollection.

I can override remove() on our view to add a call this.filter.shadowCollection.stopListening(), which allows the collection to be dereferenced and fixes the leak.

Is that the right way to do it? It would be ideal if Backgrid's own remove() method would take care of that. Or is there some other API for deactivating/destroying a ClientSideFilter instance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions