ensure screen and program globals are reset.
This commit is contained in:
parent
8007aa8ee7
commit
0d86165122
|
@ -446,6 +446,10 @@ Program.prototype.destroy = function() {
|
|||
this.flush();
|
||||
this._exiting = true;
|
||||
|
||||
if (Program.total === 1) {
|
||||
Program.global = Program.instances[0];
|
||||
}
|
||||
|
||||
if (Program.total === 0) {
|
||||
Program.global = null;
|
||||
|
||||
|
|
|
@ -391,6 +391,10 @@ Screen.prototype.destroy = function() {
|
|||
Screen.instances.splice(index, 1);
|
||||
Screen.total--;
|
||||
|
||||
if (Screen.total === 1) {
|
||||
Screen.global = Screen.instances[0];
|
||||
}
|
||||
|
||||
if (Screen.total === 0) {
|
||||
Screen.global = null;
|
||||
|
||||
|
|
Loading…
Reference in New Issue