Skip to content

Commit

Permalink
Fix imagery crash
Browse files Browse the repository at this point in the history
`ImageryLayer._reprojectTexture` was performing an asynchronous operation
without callimg `imagery.addReference` or `imagery.releaseReference` which
was causing the imagery and it's resources to be destroyed if culled
before the reprojection was complete, leading to us trying to destroy
an already destroyed texture.
  • Loading branch information
mramato committed Aug 30, 2016
1 parent 51e4fe6 commit bc8a365
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Change Log
* Added `Camera.cancelFlight` to cancel the existing camera flight if it exists.
* Fix overlapping camera flights by always cancelling the previous flight when a new one is created.
* Camera flights now disable collision with the terrain until all of the terrain in the area has finished loading. This prevents the camera from being moved to be above lower resolution terrain when flying to a position close to higher resolution terrain. [#4075](https://github.com/AnalyticalGraphicsInc/cesium/issues/4075)
* Fixed a crash that would cocur if quickly toggling imagery visibility. [#4083](https://github.com/AnalyticalGraphicsInc/cesium/issues/4083)
* Fixed an issue causing error if KML has a clamped to ground LineString with color. [#4131](https://github.com/AnalyticalGraphicsInc/cesium/issues/4131)
* Added logic to `KmlDataSource` defaulting KML Feature node to hidden unless all ancestors are visible. This better matches the KML specification.
* Fixed position of KML point features with an altitude mode of `relativeToGround` and `clampToGround`.
Expand Down
2 changes: 2 additions & 0 deletions Source/Scene/ImageryLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ define([
if (!(this._imageryProvider.tilingScheme instanceof GeographicTilingScheme) &&
rectangle.width / texture.width > 1e-5) {
var that = this;
imagery.addReference();
var computeCommand = new ComputeCommand({
persists : true,
owner : this,
Expand All @@ -773,6 +774,7 @@ define([
texture.destroy();
imagery.texture = outputTexture;
finalizeReprojectTexture(that, context, imagery, outputTexture);
imagery.releaseReference();
}
});
this._reprojectComputeCommands.push(computeCommand);
Expand Down

0 comments on commit bc8a365

Please sign in to comment.