Last active
August 29, 2015 14:10
-
-
Save cyril-sf/dbe829e11698c62ad6cb to your computer and use it in GitHub Desktop.
Ember.js Container.destroy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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