fixed #91 crash after round end

This commit is contained in:
logsol 2014-12-27 22:35:26 +01:00
parent b92cce88f2
commit 4f3a53ca53
6 changed files with 15 additions and 18 deletions

View file

@ -25,8 +25,8 @@ function () {
}
AudioPlayer.prototype.stop = function() {
this.audio.stop();
this.doPlay = false;
//this.audio.stop();
//this.doPlay = false;
};
AudioPlayer.prototype.destroy = function() {

View file

@ -180,7 +180,7 @@ function (ProtocolHelper, GameController, User, Nc, Settings, DomController) {
};
Networker.prototype.onEndRound = function() {
this.gameController.toggleInfo(true);
this.gameController.toggleGameStats(true);
};
return Networker;

View file

@ -17,6 +17,8 @@ function (Abstract) {
current: { x: 0, y: 0},
target: { x: 0, y: 0}
};
this.ncTokens = [];
}
Object.defineProperty(Layer, 'ID', {
@ -49,5 +51,9 @@ function (Abstract) {
this.zoom.target = z;
};
Layer.prototype.destroy = function() {
};
return Layer;
});

View file

@ -161,6 +161,10 @@ function (Nc, Exception, Layer) {
for (var i = 0; i < this.ncTokens.length; i++) {
Nc.off(this.ncTokens[i]);
};
for (var i = this.layers.length - 1; i >= 0; i--) {
var layer = this.layers[i];
layer.destroy();
};
};
return LayerManager;

View file

@ -180,13 +180,3 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
return Layer;
});
/*
1 = this.zoom.current ? -1
1 = this.zoom.current * (-1) * (-1)
*/

View file

@ -168,10 +168,7 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
PixiView.prototype.destroy = function() {
this.layerManager.destroy();
this.ghostLayer.destroy();
this.swiperLayer.destroy();
this.layerManager.destroy(); // also calls all layers destroy
for (var i = 0; i < this.stage.children.length; i++) {
this.stage.removeChild(this.stage.children[i]);