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

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

Open
myklemykle opened this issue Feb 9, 2017 · 0 comments

Comments

@myklemykle
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant