Skip to content

Commit

Permalink
Ensure Engine Routes are deactivated before destruction
Browse files Browse the repository at this point in the history
  • Loading branch information
trentmwillis committed Sep 10, 2016
1 parent b9dcde8 commit bb5fe60
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions packages/ember-routing/lib/system/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,20 +452,21 @@ const EmberRouter = EmberObject.extend(Evented, {
},

willDestroy() {
let instances = this._engineInstances;
for (let name in instances) {
for (let id in instances[name]) {
run(instances[name][id], 'destroy');
}
}

if (this._toplevelView) {
this._toplevelView.destroy();
this._toplevelView = null;
}

this._super(...arguments);

this.reset();

let instances = this._engineInstances;
for (let name in instances) {
for (let id in instances[name]) {
run(instances[name][id], 'destroy');
}
}
},

/*
Expand Down

0 comments on commit bb5fe60

Please sign in to comment.