Skip to content

Commit

Permalink
always reset global instances.
Browse files Browse the repository at this point in the history
  • Loading branch information
chjj committed Aug 14, 2015
1 parent 1b0d912 commit 1ae8604
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/program.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,7 @@ Program.prototype.destroy = function() {
this.flush();
this._exiting = true;

if (Program.total === 1) {
Program.global = Program.instances[0];
}
Program.global = Program.instances[0];

if (Program.total === 0) {
Program.global = null;
Expand Down
4 changes: 1 addition & 3 deletions lib/widgets/screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,7 @@ Screen.prototype.destroy = function() {
Screen.instances.splice(index, 1);
Screen.total--;

if (Screen.total === 1) {
Screen.global = Screen.instances[0];
}
Screen.global = Screen.instances[0];

if (Screen.total === 0) {
Screen.global = null;
Expand Down

0 comments on commit 1ae8604

Please sign in to comment.