FixUp: remove elements in reverse order to avoid invalidating indices

This commit is contained in:
Ben Jackson 2020-07-07 22:45:12 +01:00
commit c43f16e288

View file

@ -236,7 +236,7 @@ class VariablesView( object ):
for index, s in enumerate( self._scopes ):
if s.scope[ 'name' ] not in names:
marked.append( index )
for m in marked:
for m in reversed( marked ):
self._scopes.pop( m )
self._DrawScopes()
@ -464,7 +464,7 @@ class VariablesView( object ):
for index, v in enumerate( parent.variables ):
if v.variable[ 'name' ] not in names:
marked.append( index )
for m in marked:
for m in reversed( marked ):
parent.variables.pop( m )
draw()