Skip to content

Commit eaa3d75

Browse files
authored
Merge pull request #7213 from AnalyticalGraphicsInc/fix-post-process-crash
Fix crash when removing a post-process stage.
2 parents b8935f9 + 8429f62 commit eaa3d75

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Change Log
2727
* Fixed clipping planes on tilesets not taking into account the tileset model matrix. [#7182](https://github.com/AnalyticalGraphicsInc/cesium/pull/7182)
2828
* Fixed middle mouse button locked glitch [#7137](https://github.com/AnalyticalGraphicsInc/cesium/pull/7137)
2929
* Fixed an issue where dynamic Entities on terrain would cause a crash in platforms that do not support depth textures such as Internet Explorer [#7103](https://github.com/AnalyticalGraphicsInc/cesium/issues/7103)
30+
* Fixed an issue that would cause a crash when removing a post process stage. [#7210](https://github.com/AnalyticalGraphicsInc/cesium/issues/7210)
3031

3132
### 1.50 - 2018-10-01
3233

Source/Scene/PostProcessStageCollection.js

+3
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ define([
294294
var stages = arraySlice(this._stages);
295295
while (stages.length > 0) {
296296
var stage = stages.pop();
297+
if (!defined(stage)) {
298+
continue;
299+
}
297300
if (defined(stage.selected)) {
298301
return true;
299302
}

Specs/Scene/PostProcessStageCollectionSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,18 @@ defineSuite([
7373
}).toThrowDeveloperError();
7474
});
7575

76+
it('removes a single stage', function() {
77+
var stage1 = scene.postProcessStages.add(new PostProcessStage({
78+
fragmentShader : 'void main() { gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0); }'
79+
}));
80+
scene.renderForSpecs();
81+
expect(scene).toRender([255, 255, 0, 255]);
82+
83+
scene.postProcessStages.remove(stage1);
84+
scene.renderForSpecs();
85+
expect(scene).toRender([0, 0, 0, 255]);
86+
});
87+
7688
it('removes stages', function() {
7789
expect(scene).toRender([0, 0, 0, 255]);
7890

0 commit comments

Comments
 (0)