Skip to content

Commit 3504819

Browse files
committed
The CameraManager would incorrectly destroy the default Camera in its shutdown method, meaning that if you used a fixed mask camera and stopped then resumed a Scene, the masks would stop working. The default camera is now destroyed only in the destroy method. Fix phaserjs#4520
1 parent 0ac5d7b commit 3504819

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
* Tweens created in a paused state couldn't be started by a call to `play`. Fix #4525 (thanks @TonioParis)
1515
* If both Arcade Physics circle body positions and the delta equaled zero, the `separateCircle` function would cause the position to be set `NaN` (thanks @hizzd)
16-
17-
16+
* The `CameraManager` would incorrectly destroy the `default` Camera in its shutdown method, meaning that if you used a fixed mask camera and stopped then resumed a Scene, the masks would stop working. The default camera is now destroyed only in the `destroy` method. Fix #4520 (thanks @telinc1)
1817

1918

2019

src/cameras/2d/CameraManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,8 +681,6 @@ var CameraManager = new Class({
681681

682682
this.cameras = [];
683683

684-
this.default.destroy();
685-
686684
var eventEmitter = this.systems.events;
687685

688686
eventEmitter.off(SceneEvents.UPDATE, this.update, this);
@@ -701,6 +699,8 @@ var CameraManager = new Class({
701699
{
702700
this.shutdown();
703701

702+
this.default.destroy();
703+
704704
this.scene.sys.events.off(SceneEvents.START, this.start, this);
705705

706706
this.scene = null;

0 commit comments

Comments
 (0)