Skip to content

Instantly share code, notes, and snippets.

@cyril-sf
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyril-sf/dbe829e11698c62ad6cb to your computer and use it in GitHub Desktop.
Save cyril-sf/dbe829e11698c62ad6cb to your computer and use it in GitHub Desktop.
Ember.js Container.destroy
destroy: function() {
for (var i=0, l=this.children.length; i<l; i++) {
this.children[i].destroy();
}
this.children = [];
eachDestroyable(this, function(item) {
item.destroy();
});
Ember.run.schedule('destroy', this, function() {
this.factoryCache.eachLocal(function(key, value) {
value.prototype.container = null
value.PrototypeMixin = null
var meta = Ember.meta(value.prototype);
meta.mixins = null
// meta.proto = null;
// meta.source = null;
// value.prototype.__proto__ = null;
// value.prototype = null;
// value.__super__ = null;
});
this.factoryCache = null
});
this.parent = undefined;
this.isDestroyed = true;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment