Skip to content

Commit

Permalink
Merge pull request #5467 from emberjs/fix-teardown
Browse files Browse the repository at this point in the history
[BUGFIX] don't cause unnecessary work during destroy
  • Loading branch information
runspired committed May 8, 2018
2 parents 5b33009 + 07856f2 commit 029fbfd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addon/-private/system/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,10 @@ Store = Service.extend({

_internalModelDestroyed(internalModel) {
this._removeFromIdMap(internalModel);
this._relationshipsPayloads.unload(internalModel.modelName, internalModel.id);

if (!this.isDestroying) {
this._relationshipsPayloads.unload(internalModel.modelName, internalModel.id);
}
},

/**
Expand Down Expand Up @@ -2625,6 +2628,7 @@ Store = Service.extend({
this._pushedInternalModels = null;
this.recordArrayManager.destroy();

this._relationshipsPayloads = null;
this._adapterCache = null;
this._serializerCache = null;

Expand Down

0 comments on commit 029fbfd

Please sign in to comment.