@@ -257,7 +257,6 @@ import SceneMode from './SceneMode.js';
257
257
*/
258
258
PolylineCollection . prototype . remove = function ( polyline ) {
259
259
if ( this . contains ( polyline ) ) {
260
- this . _polylines [ polyline . _index ] = undefined ; // Removed later
261
260
this . _polylinesRemoved = true ;
262
261
this . _createVertexArray = true ;
263
262
this . _createBatchTable = true ;
@@ -1046,13 +1045,12 @@ import SceneMode from './SceneMode.js';
1046
1045
var definedPolylines = [ ] ;
1047
1046
var polyIndex = 0 ;
1048
1047
var polyline ;
1049
- var i ;
1050
1048
1051
1049
var length = collection . _polylines . length ;
1052
1050
var definedPolylinesToUpdate = [ ] ;
1053
- for ( i = 0 ; i < length ; ++ i ) {
1051
+ for ( var i = 0 ; i < length ; ++ i ) {
1054
1052
polyline = collection . _polylines [ i ] ;
1055
- if ( defined ( polyline ) && defined ( polyline . _polylineCollection ) ) {
1053
+ if ( ! polyline . isDestroyed ) {
1056
1054
polyline . _index = polyIndex ++ ;
1057
1055
definedPolylinesToUpdate . push ( polyline ) ;
1058
1056
definedPolylines . push ( polyline ) ;
@@ -1068,7 +1066,7 @@ import SceneMode from './SceneMode.js';
1068
1066
var polylines = collection . _polylines ;
1069
1067
var length = polylines . length ;
1070
1068
for ( var i = 0 ; i < length ; ++ i ) {
1071
- if ( defined ( polylines [ i ] ) ) {
1069
+ if ( ! polylines [ i ] . isDestroyed ) {
1072
1070
var bucket = polylines [ i ] . _bucket ;
1073
1071
if ( defined ( bucket ) ) {
1074
1072
bucket . shaderProgram = bucket . shaderProgram && bucket . shaderProgram . destroy ( ) ;
@@ -1097,7 +1095,7 @@ import SceneMode from './SceneMode.js';
1097
1095
var polylines = collection . _polylines ;
1098
1096
var length = polylines . length ;
1099
1097
for ( var i = 0 ; i < length ; ++ i ) {
1100
- if ( defined ( polylines [ i ] ) ) {
1098
+ if ( polylines [ i ] . isDestroyed ) {
1101
1099
polylines [ i ] . _destroy ( ) ;
1102
1100
}
1103
1101
}
0 commit comments