Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX beta] prevent calls to store.query leaking #4042

Merged

Conversation

fivetanley
Copy link
Member

Although the result from store.query is intended to never be re-used
as we delegate to the server for the truth of a query, the user still
needs an escape hatch to destroy these AdapterPopulatedRecordArrays
created by query in order to prevent excessive memory.

Before, calling destroy on an AdapterPopulatedRecordArray (the type
returned from store.query), the logic in
RecordArrayManager#unregisterRecordArray did not account for adapter
populated record arrays resulting in a leak.

This commit changes the logic to search for the array in the
RecordArrayManager's AdapterPopulatedRecordArray collection when
unregistering a record array.

Fixes #4041

Although the result from `store.query` is intended to never be re-used
as we delegate to the server for the truth of a query, the user still
needs an escape hatch to destroy these AdapterPopulatedRecordArrays
created by query in order to prevent excessive memory.

Before, calling `destroy` on an AdapterPopulatedRecordArray (the type
returned from store.query), the logic in
RecordArrayManager#unregisterRecordArray did not account for adapter
populated record arrays resulting in a leak.

This commit changes the logic to search for the array in the
RecordArrayManager's AdapterPopulatedRecordArray collection when
unregistering a record array.

Fixes emberjs#4041
fivetanley added a commit that referenced this pull request Jan 5, 2016
…ay-leaks

[BUGFIX beta] prevent calls to store.query leaking
@fivetanley fivetanley merged commit 1c02f8f into emberjs:master Jan 5, 2016
@fivetanley fivetanley deleted the adapter-populated-record-array-leaks branch January 5, 2016 05:26
@fivetanley fivetanley restored the adapter-populated-record-array-leaks branch January 5, 2016 05:26
@GeekSMN
Copy link

GeekSMN commented Dec 1, 2016

In the changelog I only see this fix for 2.3.0, was it merged to 1.13.x anywhere?

@bmac
Copy link
Member

bmac commented Dec 1, 2016

I do not believe this pr was merged into 1.13 @GeekSMN.

@GeekSMN
Copy link

GeekSMN commented Dec 1, 2016

Would getting this in 1.13 be possible or are there blocking differences? We're seeing a gradual leak that could be this, but can't migrate to 2.0 just yet.

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

Successfully merging this pull request may close these issues.

3 participants