From 500cb03e9635b04bae7b9f9824806afdfcec1df5 Mon Sep 17 00:00:00 2001 From: "David J. Hamilton" Date: Fri, 21 Oct 2016 10:05:21 -0700 Subject: [PATCH] feedback better unload --- addon/-private/system/model/internal-model.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/addon/-private/system/model/internal-model.js b/addon/-private/system/model/internal-model.js index 43631fd1a53..4425b6c4a84 100644 --- a/addon/-private/system/model/internal-model.js +++ b/addon/-private/system/model/internal-model.js @@ -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();