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?
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?