Tools__ViewTreeApplication.st
changeset 3209 c13a1f4f4ccb
parent 3186 80a20e5881a5
child 3210 d74ece5bbce1
     1.1 --- a/Tools__ViewTreeApplication.st	Thu Mar 26 11:20:01 2015 +0100
     1.2 +++ b/Tools__ViewTreeApplication.st	Mon May 04 16:41:15 2015 +0200
     1.3 @@ -1,3 +1,5 @@
     1.4 +"{ Encoding: utf8 }"
     1.5 +
     1.6  "
     1.7   COPYRIGHT (c) 2007 by eXept Software AG
     1.8                All Rights Reserved
     1.9 @@ -2900,18 +2902,29 @@
    1.10  !ViewTreeInspectorApplication::ViewTreeItem methodsFor:'operations update'!
    1.11  
    1.12  updateChildren
    1.13 -    |list|
    1.14 -
    1.15 -    self do:[:el|
    1.16 -        el exists ifTrue:[
    1.17 -            el updateChildren.
    1.18 -        ] ifFalse:[
    1.19 -            list isNil ifTrue:[list := OrderedCollection new].
    1.20 -            list add:el.
    1.21 -        ]
    1.22 -    ].
    1.23 -    list notNil ifTrue:[
    1.24 -        list do:[:el| self remove:el ].
    1.25 +    |queue|
    1.26 +
    1.27 +    queue := OrderedCollection new.
    1.28 +    queue add:self.
    1.29 +
    1.30 +    self criticalDo:[
    1.31 +        [queue notEmpty] whileTrue:[
    1.32 +            |toRemove  elProcessed|
    1.33 +
    1.34 +            elProcessed := queue removeFirst.
    1.35 +            toRemove := nil.
    1.36 +            elProcessed nonCriticalDo:[:el|
    1.37 +                el exists ifTrue:[
    1.38 +                    queue add:el.
    1.39 +                ] ifFalse:[
    1.40 +                    toRemove isNil ifTrue:[toRemove := OrderedCollection new].
    1.41 +                    toRemove add:el.
    1.42 +                ]
    1.43 +            ].
    1.44 +            toRemove notNil ifTrue:[
    1.45 +                toRemove do:[:el| self remove:el ].
    1.46 +            ].
    1.47 +        ].
    1.48      ].
    1.49  !
    1.50