'From etoys2.2 of 1 October 2007 [latest update: #1753] on 5 November 2007 at 4:56:13 pm'! "Change Set: TryHardToCleanup-yo Date: 5 November 2007 Author: Yoshiki Ohshima In the World's references dictionary, a deletion can open the door for more deletion. It should loop untill it reaches a stable point."! !PasteUpMorph methodsFor: '*siss-interface' stamp: 'yo 11/5/2007 16:54'! cleanUpReferences | all v w before now | all _ self presenter reallyAllExtantPlayersNoSort. self referencePoolIfPresentDo: [:ref | before _ SmallInteger maxVal. now _ ref size. [before > now] whileTrue: [ ref keysDo: [:k | (v _ ref at: k) ifNil: [ref removeKey: k] ifNotNil: [ v isPlayerLike ifTrue: [ (all includes: v) ifFalse: [ref removeKey: k] ifTrue: [ ((w _ v costume topPasteUp) notNil and: [w ~~ self]) ifTrue: [ w isWorldMorph ifTrue: [ref removeKey: k]]]]]]. before _ now. now _ ref size. ]. ]. ! !