@jalapano wrote:
I'm wondering if calling destroy() on an Ember.Object that was explicitly created (i.e. not automatically created by the Ember framework) is necessary.
The documentation says that destroy() cleans any meta and bindings on the object. If you set null out the property that stored the Object, would that be sufficient or will data still be leaked and the object not be garbage collected?
Ember.Component.extend({ testObject: null, init() { this._super(...arguments); this.set('testObject', Ember.Object.create()); }, willDestroy() { this._super(...arguments); this.set('testObject', null); // Will this allow testObject to be garbage collected? } });
Posts: 4
Participants: 2