FixUp: remove elements in reverse order to avoid invalidating indices
This commit is contained in:
parent
4b7fc83ce3
commit
c43f16e288
1 changed files with 2 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue