Skip to content

Commit 00cf44e

Browse files
committed
If running under Cordova and iOS the Game.lockRender boolean will be set to true when the game pauses and false when it resumes. This avoids the gpus_ReturnNotPermittedKillClient app crash on iOS (thanks @cncolder phaserjs#1800)
1 parent ab8c986 commit 00cf44e

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ Version 2.4 - "Katar" - in dev
384384
* TilemapParser.parseTiledJSON would ignore 'falsey' properties set on Objects in Tiled JSON tilemaps, such as `x: 0` or `visible: false`. These properties are now accurately copied over to the destination map data (thanks @MaksJS #1818)
385385
* Removed un-necessary PIXI.TextureCache pollution in Phaser.LoaderParser.bitmapFont.
386386
* Sound.resume wouldn't properly restart looped sounds in Chrome after being paused. Phaser now specifically handles the Chrome 42 bug and later fix (thanks @nkovacs #1820)
387+
* Setting the BitmapText.maxWidth property would throw an error (thanks @drhayes #1807)
388+
* If running under Cordova and iOS the Game.lockRender boolean will be set to `true` when the game pauses and `false` when it resumes. This avoids the `gpus_ReturnNotPermittedKillClient` app crash on iOS (thanks @cncolder #1800)
387389

388390
For changes in previous releases please see the extensive [Version History](https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md).
389391

src/core/Game.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant
243243
this.context = null;
244244

245245
/**
246-
* @property {Phaser.Utils.Debug} debug - A set of useful debug utilitie.
246+
* @property {Phaser.Utils.Debug} debug - A set of useful debug utilities.
247247
*/
248248
this.debug = null;
249249

@@ -1007,6 +1007,12 @@ Phaser.Game.prototype = {
10071007
this.time.gamePaused();
10081008
this.sound.setMute();
10091009
this.onPause.dispatch(event);
1010+
1011+
// Avoids Cordova iOS crash event: https://github.com/photonstorm/phaser/issues/1800
1012+
if (this.device.cordova && this.device.iOS)
1013+
{
1014+
this.lockRender = true;
1015+
}
10101016
}
10111017

10121018
},
@@ -1028,6 +1034,12 @@ Phaser.Game.prototype = {
10281034
this.input.reset();
10291035
this.sound.unsetMute();
10301036
this.onResume.dispatch(event);
1037+
1038+
// Avoids Cordova iOS crash event: https://github.com/photonstorm/phaser/issues/1800
1039+
if (this.device.cordova && this.device.iOS)
1040+
{
1041+
this.lockRender = false;
1042+
}
10311043
}
10321044

10331045
},

0 commit comments

Comments
 (0)