Skip to content

Commit

Permalink
feedback better unload
Browse files Browse the repository at this point in the history
  • Loading branch information
hjdivad committed Oct 21, 2016
1 parent 28a64fe commit 500cb03
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions addon/-private/system/model/internal-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,18 @@ InternalModel.prototype = {
return array;
},

/**
Unload the record for this internal model. This will cause the record to be
destroyed and freed up for garbage collection. It will also trigger a check
for cleaning up internal models.
This check is performed by first computing the set of related internal
models. If all records in this set are unloaded, then the entire set is
destroyed. Otherwise, nothing in the set is destroyed.
This means that this internal model will be freed up for garbage collection
once all models that refer to it via some relationship are also unloaded.
*/
unloadRecord() {
this.send('unloadRecord');
this.dematerializeRecord();
Expand Down

0 comments on commit 500cb03

Please sign in to comment.