PolylineCollection update instanceIndex is out of range
See original GitHub issueBrowser: Chrome Operating System: MacOS Cesium version: 1.5.3
Hi, we have an app where we create and destroy a bunch of Polyline’s. Basically the user cycles through different polylines, and every time they select a new one we delete the ones they were previously looking at and create the ones they’re looking at now using.
The polylines also have a CallbackProperty
on the positions
property that updates the positions every frame.
We get an error from Cesium originating on this line:
Quite reliably when we delete a set of polylines and then immediately render frames. If we remove the CallbackProperty
the error does not occur.
Are we hitting some race condition bug where callback properties are setting a dirty flag on polylines that already have been deleted?
We’re creating the polylines with viewer.entities.add
and destroying them with viewer.entities.remove
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (14 by maintainers)
Top GitHub Comments
Ok we made some progress, this Sandcastle is huge, but if you leave this running for a couple minutes you’ll eventually get the instanceIndex is out of range error:
https://sandcastle.cesium.com/#c=7Vptc9s2Ev4raD7U1JwCE3ynHGcudXy5XpPYE7vNdWxPh6YgiQlF8gjKjpvqv9+CAEmApGyn13TuZi7tJCKw2F3sy4PFkjdRiW4SektLdIgyeouOKEs2a/xTPWbsxfXjUZ5VUZLRcm+KPl9mCFW0LGHgtMxvkjktZ82yuKRRRd/nZTo/FyTGZMoXlPRfG8qqdzQD8jf5nM5QVW4ozG0nB5fZZSaUwCymGcVzer1Znq3y27+V0ZqyU1qe0TjP5qAjX1XTg+JVklJGK11z8Y/98lxMGrW+mzKdob1VVRVstr/PqryMlhQv83yZ0qhIGI7z9X5Ey5zFUfY0YrCQPZ3Tm/15VEW/8Kd9izz94e/lzT8259Z3VfniReJ75T/Pfj6iP57tS0XwB5Zne+NbKspknVTJDWU4ms8NuYITSrJf83x9nqsTl9lik8VVkmeo2KTpac4S/nCeH4FRysgo5MBE+KSk1abUSVlLe9EQX00uzCtQcSd7NuDPegKaYbyOCsMoJujwuSBACJzEKhTNP2xYRec9x0RlBb+izDYmKvU8KalQ4xBpJotrNXA7LxYNuOGMLiHojJZu2iow2bkkL9dRmvxKjYb0EYvWm7RKivTuu7uzOEqjUllrYtN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iGIe05VkfiPKaLi0SrqDyqiurNUrQj6tlUTVFbkR6f31uT69ANVuU7cr+Z2KfM7ouNPq6uUtlh3Rfssbv56K1rtwFwhZR1cwqujiFH5HcCuC+Pgfsg5wGn0PTi7vIlSI2J3WYyUr0saxnjs1sMJotsoqdCcptGdQUzTnGirlCqwDwsQzYukZKLDsfdoXvoB8QDWqGL0ltDXEkiu6iytvyn+vRJHBKlsG2bbKXIFB/6f8Fz74a2Q0Bzc+ne2PEIAXtYJo4ZRUpanN/ztBuXoo0Y3BMZ5sqb5puqoWo7KF6JPpk+eseoupc/Fur8msG/At02ZGhjvV3Rd8LqF7V9v4o8UcIbVL8+f7TeLns2TG5TMDy+f9L4Kv3yC6g4IzCygbubfsV0+ef5sH+i1ZWleFzsnN7SEbXOSFXn+WgxijJ/tw+NwVZXn6TXkYcfx3w
It’s a bit annoying that it takes a couple minutes, and that it’s such a large slice of code, so we’ll continue whittling away at it.
BTW the tileset used in that Sandcastle is property of my employer, please don’t use it for any other purpose than researching this bug.
Here’s a reduced test case I got over email. I’m able to pretty consistently reproduce this now, crashes almost immediately when switching out to another tab and back.