Skip to content

Commit 831e467

Browse files
committed
Merge pull request #2630 from AnalyticalGraphicsInc/never-mind
Fix crash when adding and removing a billboard before next update.
2 parents b691b8a + ec773ab commit 831e467

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Source/Scene/BillboardCollection.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,8 @@ define([
10151015
* @exception {RuntimeError} image with id must be in the atlas.
10161016
*/
10171017
BillboardCollection.prototype.update = function(context, frameState, commandList) {
1018+
removeBillboards(this);
1019+
10181020
var billboards = this._billboards;
10191021
var billboardsLength = billboards.length;
10201022

@@ -1036,7 +1038,6 @@ define([
10361038
return;
10371039
}
10381040

1039-
removeBillboards(this);
10401041
updateMode(this, frameState);
10411042

10421043
billboards = this._billboards;

Specs/Scene/BillboardCollectionSpec.js

+6
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ defineSuite([
122122
expect(b.id).not.toBeDefined();
123123
});
124124

125+
it('can add and remove before first update.', function() {
126+
var b = billboards.add();
127+
billboards.remove(b);
128+
billboards.update(context, frameState, []);
129+
});
130+
125131
it('explicitly constructs a billboard', function() {
126132
var b = billboards.add({
127133
show : false,

0 commit comments

Comments
 (0)