Skip to content

Commit a8d38aa

Browse files
authored
Merge pull request #6918 from AnalyticalGraphicsInc/fix-tile-crash
Fix crash with switching terrain provider and picking
2 parents 8fa64c1 + 4eee696 commit a8d38aa

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Change Log
2323
* Improved `Plane` entities so they are better aligned with the globe surface [#6887](https://github.com/AnalyticalGraphicsInc/cesium/pull/6887)
2424
* Fixed crash when rendering translucent objects when all shadow maps in the scene set `fromLightSource` to false. [#6883](https://github.com/AnalyticalGraphicsInc/cesium/pull/6883)
2525
* Fixed night shading in 2D and Columbus view. [#4122](https://github.com/AnalyticalGraphicsInc/cesium/issues/4122)
26+
* Fixed crash that happened when calling `scene.pick` after setting a new terrain provider [#6918](https://github.com/AnalyticalGraphicsInc/cesium/pull/6918)
2627

2728
### 1.48 - 2018-08-01
2829

Source/Scene/QuadtreePrimitive.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ define([
300300
return;
301301
}
302302

303+
if (this._tilesInvalidated) {
304+
invalidateAllTiles(this);
305+
this._tilesInvalidated = false;
306+
}
307+
303308
// Gets commands for any texture re-projections
304309
this._tileProvider.initialize(frameState);
305310

@@ -376,16 +381,10 @@ define([
376381
return;
377382
}
378383

379-
if (this._tilesInvalidated) {
380-
invalidateAllTiles(this);
381-
}
382-
383384
// Load/create resources for terrain and imagery. Prepare texture re-projections for the next frame.
384385
processTileLoadQueue(this, frameState);
385386
updateHeights(this, frameState);
386387
updateTileLoadProgress(this, frameState);
387-
388-
this._tilesInvalidated = false;
389388
};
390389

391390
/**

Specs/Scene/GlobeSurfaceTileProviderSpec.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,14 @@ defineSuite([
674674
var surface = scene.globe._surface;
675675
var replacementQueue = surface._tileReplacementQueue;
676676
expect(replacementQueue.count).toBeGreaterThan(0);
677+
var oldTile = replacementQueue.head;
677678

678679
surface.tileProvider.terrainProvider = new EllipsoidTerrainProvider();
679680

680681
scene.renderForSpecs();
681682

682-
expect(replacementQueue.count).toBe(0);
683+
expect(replacementQueue.count).toBeGreaterThan(0);
684+
expect(replacementQueue.head).not.toBe(oldTile);
683685
});
684686
});
685687

0 commit comments

Comments
 (0)